Fonts look better scaled down

Miscellaneous Forums/General Discussion/Fonts look better scaled down

I was previously using ttf fonts in my game and I found it was better to load them in x2 or x4 the size I wanted them drawn at and then using SetScale (BMax) to draw them smaller. This resulted in more "accurate" looking fonts, although with a slight blur sometimes which I partially corrected by forcing each char to be drawn at integer not floating point coords.

Now I've moved over to bitmap fonts and I've found the same thing. Basically Arial Bold at 18 point seems to be a bit "mishapen" although it is "crisp". So if I make a 36 point bitmap font and scale it down by half when drawing the letters are more accurate but then I have more anti-alias than is desired.

Anyone else found the same thing?

What get's me is why they are more accurate when drawn by the video card half size than by a bitmap font program. Perhaps the video card is using better anti-aliasing? I realised that the bitmap font program has FULL access to the ttf font data (so should produce super accurate bitmap fonts) and the video card only has access to a x2 bitmap font, so it should actually be worse. Ho hum...

With TTF fonts, you need to use the SMOOTHFONT flag if you plan to scale it - not sure if that effects the original size though. TTFs are internally converted to bitmap fonts anyway.

With images, similar problem, but use FILTEREDIMAGE and/or MIPMAPPEDIMAGE flags when scaling.

If you have images that are too small from the outset, it'll look crap whatever you do.

[edit] This just in from Captain Obvious - don't forget to use ALPHABLEND when drawing fonts.

Yep I've always been using SMOOTHFONT, in fact it's the default paramater for LoadImageFont.

Yep tried MIPMAPPEDIMAGE and FILTEREDIMAGE for scaling down bitmap fonts but it goes too blurry, without MIPMAPPEDIMAGES it's better (well crisper but with worse AA).

Just a thought - does Windows font smoothing/cleartype effect the 'look' of fonts in Blitz?

I know it did in Blitzplus because I turned smoothing on to get better results with Beaker's FONText.

One more thing - just checked the docs and FILTEREDIMAGE is on by default. Tried using 0 for the flags param?

I did have this problem myself when I first started with Blitzmax, and I remember finding a way around it... just can't quite remember what I did.

When I render the bitmap I make it double size and the text non-antialias. I then import the bitmap into photoshop and reduce it by 50% using bi-linear filtering. I find this gives excellent results at most scale factors (apart from too big!!).

GfK: no idea. I want to know what the SMOOTHFONT flag actually does. The best looking I got was loading say Arial at 4x (or more) my desired size with SMOOTHFONT, then drawing it scaled down by 4 and with some special code to put each letter at an integer coordinate (to avoid blurring due to floating point coord filtering). This has given me a better result than bitmap fonts (drawn normally or scaled down) so far.

Indiepath: OK, I'll try that thanks.

I want to know what the SMOOTHFONT flag actually does.
It applies MIPMAPPING and FILTERING

thx. That's all? Somehow it's still better than the results I'm getting with bitmap fonts.

Tried x2 non-antialiased and downsized and tried x4 as well. Use gimp and "cubic" to scale down which I'm sure is good. x4 is the best I've seen all day (my eyes are strained to hell now...), but still not as good as the ttf font. Wish I could post a screenie but NDA and all that.

Bah, turns out all I needed to do was use AA Super Sampling x4 instead of x1, never knew it made such a big difference!