<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi Andreas,<BR>
I think the problem with the size discrepency results from the scaling factor used in TTCFont computeForm:<BR>
&nbsp;<BR>
FreeType divides the pixel size by the units per em , but TTCFont divides by (ttcDescription ascender - ttcDescription descender).<BR>
&nbsp;<BR>
Try making TTCFont&gt;&gt;computeForm: use the unitsPerEm value instead, it appears to give the correct size glyphs. i.e. ...<BR>
<BR>computeForm: char<BR>
&nbsp;| ttGlyph scale |<BR>&nbsp;scale := self pixelSize asFloat /&nbsp; ttcDescription unitsPerEm.<BR>&nbsp;Scale ifNotNil: [scale := Scale * scale].<BR>
&nbsp;<BR>
etc.<BR>
&nbsp;<BR>
This is from the FreeType manual page <A href="http://freetype.sourceforge.net/freetype2/docs/glyphs/glyphs-2.html">http://freetype.sourceforge.net/freetype2/docs/glyphs/glyphs-2.html</A>&nbsp;...<BR>
&nbsp;<BR>
&lt;quote&gt;<BR>
In creating the glyph outlines, a type designer uses an imaginary square called the <EM>EM square</EM>. Typically, the EM square can be thought of as a tablet on which the characters are drawn. The square's size, i.e., the number of grid units on its sides, is very important for two reasons:<BR>
<UL>
<LI>
It is the reference used to scale the outlines to a given text dimension. For example, a size of 12pt at 300x300&nbsp;dpi corresponds to 12*300/72&nbsp;=&nbsp;50&nbsp;pixels. This is the size the EM square would appear on the output device if it was rendered directly. In other words, scaling from grid units to pixels uses the formula:<BR>

<CENTER><TT>pixel_size = point_size * resolution / 72</TT><BR><TT>pixel_coord = grid_coord * pixel_size / EM_size</TT> </CENTER>
<P><BR></LI></UL>
&lt;/quote&gt;<BR>
&nbsp;<BR>
Line spacing is a separate issue; it is there that the ascender, descender, and other vertical metrics become important&nbsp;.<BR>
&nbsp;<BR>
Cheers,<BR>
Andy<BR>
<BR>.<BR><BR><BR>&nbsp;<BR>&gt; Date: Fri, 28 Aug 2009 20:22:19 -0700<BR>&gt; From: andreas.raab@gmx.de<BR>&gt; To: squeak-dev@lists.squeakfoundation.org<BR>&gt; Subject: [squeak-dev] Cuis font sizes<BR>&gt; <BR>&gt; Hi Juan -<BR>&gt; <BR>&gt; This is mostly to Juan but others might be able to help as well. I <BR>&gt; noticed that the Cuis fonts disagree in their pixel sizes significantly <BR>&gt; with that we get from the plain DejaVu true type fonts in Squeak. A bit <BR>&gt; of math reveals that at the (assumed) screen resolution of 96dpi a 12pt <BR>&gt; font should result in 16px high font (12*96/72 see Eqn. 3 in [1]). The <BR>&gt; corresponding Bitmap DejaVu 12pt font, however, is 19px high which would <BR>&gt; mean a screen resolution of 114dpi (19*72/12).<BR>&gt; <BR>&gt; Is this choice intentional? Unfortunately, none of the pixel sizes for <BR>&gt; Bitmap DejaVu correspond exactly to a point size when assuming 96dpi.<BR>&gt; <BR>&gt; The reason this is causing me grief is that I am trying to set up a <BR>&gt; mechanism for allowing people to drop the DejaVu fonts into their images <BR>&gt; and have any glyphs not part of the cuis fonts rendered in DejaVu <BR>&gt; truetype instead. I can probably get the truetype rendering to spit out <BR>&gt; a precise pixel size to match it but I think it'd be good if we had <BR>&gt; clarity on how these pixel sizes came into being.<BR>&gt; <BR>&gt; Any insights appreciated!<BR>&gt; <BR>&gt; Cheers,<BR>&gt; - Andreas<BR>&gt; <BR>&gt; [1] http://www.emdpi.com/emsquare.html<BR>&gt; <BR><br /><hr />View your other email accounts from your Hotmail inbox. <a href='http://clk.atdmt.com/UKM/go/167688463/direct/01/' target='_new'>Add them now.</a></body>
</html>