Truetype fonts rendered too large

Hi,
I’m using v0.062 on the iPhone and have noticed that fonts appear to be rendered larger than I expect. For example, rendering a 100pt Verdana text results in text that is about 20% larger than what other software renders it.

I’m using ofTrueTypeFont to load the font, then drawString() to render it.

Does anybody know what might be going on here, or have a workaround?

The first entry on this-discussion-page mentions a similar problem, but no follow up solution.

Thanks in advance,
Rob.

A little more digging and I think I might be able to answer my own question…

ofTrueTypeFont::loadFont(…) makes the following FreeType function call:

  
   FT_Set_Char_Size( face, fontsize << 6, fontsize << 6, 96, 96);  

According to the FreeType-API-documentation, the last two parameters correspond to horizontal and vertical resolution in DPI. Replacing the hard-coded 96 with 72 (which at least suits the iPhone simulator) gives me output of the expected size.

It would probably be sensible to allow the DPI resolutions to be specified as arguments to loadFont() rather than hard-coding them…

I created an issue here: https://github.com/openframeworks/openF-…-issues/498

Thanks! I didn’t think to do that. Will do next time.