[squeak-dev] Cuis font sizes

Juan Vuletich juan at jvuletich.org
Sat Aug 29 17:23:57 UTC 2009


Juan Vuletich wrote:
> Hi Andreas,
>
> Andreas Raab wrote:
>> Hi Juan -
>>
>> This is mostly to Juan but others might be able to help as well. I 
>> noticed that the Cuis fonts disagree in their pixel sizes 
>> significantly with that we get from the plain DejaVu true type fonts 
>> in Squeak. A bit of math reveals that at the (assumed) screen 
>> resolution of 96dpi a 12pt font should result in 16px high font 
>> (12*96/72 see Eqn. 3 in [1]). The corresponding Bitmap DejaVu 12pt 
>> font, however, is 19px high which would mean a screen resolution of 
>> 114dpi (19*72/12).
>>
>> Is this choice intentional? Unfortunately, none of the pixel sizes 
>> for Bitmap DejaVu correspond exactly to a point size when assuming 
>> 96dpi.
>
> The BitmapDejaVu 12 has the glyphs rendered by FreeType when requested 
> for 12 pt. In those glyphs, the H (for example) is 12 pixels high. Max 
> ascent for uppercase letters with Latin umlauts is 15 pixels. Max 
> descent in those glyphs is 4. Therefore instances of BitmapDejaVu 12 
> StrikeFont answer 15 to #ascent, 4 to #descent and 19 (15+4) to #height.
>
> I never found a clear specification of the meaning of  '12 point', and 
> I'm totally for making the fonts behave properly. So, the first 
> question is: Are the glyphs correct? I mean, are the glyphs for DejaVu 
> 12 rendered by Squeak TTF and Freetype the same size? If so, how does 
> Squeak TTF fit glyphs that might need up to 19 pixels (15+4) in 16? I 
> suspect that FreeType and Squeak TTF don't agree on the meaning of 
> point size, but I don't have time right now for checking.
>
> I'll have time for this on Monday. I guess the first thing to do is to 
> understand what is the correct font for '12 point'. I mean, the 
> correct ascent/descent and line grid, and the correct shape of the 
> glyphs. Some specification of mean kerning / length of strings would 
> be nice too. I'll read the link you sent. I want to understand and get 
> this right!

According to http://www.emdpi.com/fontsize.html , the example *"Arial 
12pt at 96 dpi:"*a 12pt font at 96 dpi should have a "font size" of 16 
pixels, but a "font height" of 18 and not 16... I guess neither TTF nor 
FreeType got it right...

Cheers,
Juan Vuletich




More information about the Squeak-dev mailing list