Font size bug?

oiking

23-12-2009 10:08:40

While optimizing the font textures for our game I've started optimizing code point ranges within our font definitions to throw out unneccessary characters. When I was done, the font was displayed larger than before. After checking I've changed nothing with the font' height or resolution attributes I reverted to the old codepoint range and the font got smaller again.
I could trace this behaviour down to a single codepoint which reproduces the problem, so I sticked to just include this codepoint to keep the font the original height.

Normal font height:
<Font name="HandballMenu" default_height="32" source="impact.ttf" size="32" resolution="50" antialias_colour="false" space_width="4" tab_width="8" cursor_width="2" distance="6" offset_height="0">
<Code range="33 250"/>
<Code range="290" /> <!-- Remove codepoint 290 and you get a larger font size in your apps -->
<Code range="1025 1105"/>
<Code hide="127 159"/>
<Code hide="1026 1039"/>
<Code hide="1104"/>
<Code range="8364" />
</Font>


Larger font height:
<Font name="HandballMenu" default_height="32" source="impact.ttf" size="32" resolution="50" antialias_colour="false" space_width="4" tab_width="8" cursor_width="2" distance="6" offset_height="0">
<Code range="33 250"/>
<Code range="1025 1105"/>
<Code hide="127 159"/>
<Code hide="1026 1039"/>
<Code hide="1104"/>
<Code range="8364" />
</Font>


This is very visibly reproducable with the Impact font, but the DejaVuSans.ttf also has a slight (but not so obvious) height&width change.
I couldn't find similar problems in this forum so I think this might have never been happend before so I hope this report is helpful :-)