DX7 Projection Matrix & Ugly Fonts

BlitzMax Forums/BlitzMax Programming/DX7 Projection Matrix & Ugly Fonts

Pragun(Posted 2006) [#1]
Hey guys,

I'm currently programming a game for 1280x1024 (I know, I know...its high for a game)...
It works great when the resolution is 1024x768 and also when it is 1600x1200.

However, I just tried setting it to 800x600 and the font quality has become so fuzzy. The crispiness from 1280x1024 and 1024x768 are completely gone.

Is there a way to stop the fuzziness from happening when resized to lower resolutions? I can understand the reasoning behind it fuzzing a little for making resolutions higher, but for making them smaller, I can't figure it out.

Any help is appreciated.

Here is a screenshot of my dilemma:



fredborg(Posted 2006) [#2]
Try disabling SMOOTHFONT when loading the font. It's due to mipmapping you get blurred results.


Pragun(Posted 2006) [#3]
[edit: oops, it wasn't off]

I turned it off and it isn't super fuzzy now but the font is just icky because of all of the curves & things in it...

Is there some place to modify how smoothfont operates or how much it smooths?


skidracer(Posted 2006) [#4]
If you discover one, I would apply for a patent immediately.


Pragun(Posted 2006) [#5]
So my best bets would be to:

1) Design for 1024x768, and allow options for 800x600,1024x768,1280x1024; take out 1600x1200

2) Leave out 800x600 Support

3) Allow 800x600 but give a warning about text quality

as apparently there is no way to fix the above?


fredborg(Posted 2006) [#6]
In brl.mod/max2d.mod/imagefont.bmx you can try commenting out MIPMAPPEDIMAGE on line 111. Then rebuild modules (Ctrl+D) and try using SMOOTHFONT again.


Pragun(Posted 2006) [#7]
AFAIK, I read somewhere that FILTEREDIMAGE doesn't do anything without MIPMAPPEDIMAGE, but I'll try modifying that line, I know which one you're talking about..

[edit]yeah, that achieves the same effect as setting the flags to 0 in LoadImageFont


skidracer(Posted 2006) [#8]
There is no magic rendering mode that will fix this.

I would disable the projection matrix for drawing text and use a different font size for each resolution.

1280x1024 has a different pixel aspect / shape than the other resolutions which will unfortunately require a hack to max fonts to get similar results.


ImaginaryHuman(Posted 2006) [#9]
How about you load the font as twice as big as it should be, draw it without any smoothing, grab it into a smooth-filtered image and then draw the image at half size? The filtering should automatically antialiase it for you. Of course you'd have to then draw the individual glyphs yourself rather than using official fonts.


Pragun(Posted 2006) [#10]
alright thanks guys, i just had an idea, i will try to figure something out and let you know what I do.. :)

[edit] nevermind, i just realized it was a dumb idea that wouldn't work.


Jay Kyburz(Posted 2006) [#11]
>If you discover one, I would apply for a patent immediately.

Photoshop ships with a least 4 types of smoothing for fonts.

If i were you i wouldn't use rendered text for these static menu items. I would create a texture in Photoshop. Make sure they are power of 2 and they will be smoothed in the same way and any other texture is.

You will be able to use funky photoshop effects on them too!