BitmapFont/BitmapFontCache Changes

Attention. Today i fixed this bug. This means that if you use BitmapFont or BitmapFontCache all your text is rendered at integer positions. If you need float positions use the BitmapFont.setUseIntegerPositions() and BitmapFontCache.setUseIntegerPositions() methods to get the old behaviour.

What is the problem? When you render text at non-integer positions, and when your glyphs have very fine grained stems, the texture filters will make your text look crazy bad. It’s most appearant for text that is centered, since you end up with very non-integer positions for each glyph. Here’s an image:

Both texts are rendered at non-integer positions. For the white text the BitmapFont was configured to cast the positions and sizes to int before drawing. The red things you see is the same text, at the same positions without the casting to integer. Fugly eh?

If you didn’t need float positions & sizes so far, nothing has changed for you.

Leave a Reply

Your email address will not be published.