freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft] FreeType Metrics Question


From: Andreas Sandberg
Subject: [ft] FreeType Metrics Question
Date: Fri, 3 Aug 2012 21:12:41 -0700

Greetings List,

        I'm very new to font rendering and any type of graphics manipulation so I apologize in advance if this question is somewhat juvenile.  I'm developing a web application and noticed that the rendering that is happening for certain fonts in chrome is very different than how some proprietary layout tools are rendering the same font.  This causes an issue for me as I'm trying to get the rendering to be somewhat identical.  I've been trying to use the free type library to pull out some metrics to see if I could figure out what the rendering engines are doing differently and if I could account for this difference.  What I'm seeing is that for some fonts, and for this example specifically Patua-one, there appears to be a lot of white space from the top of the text within a glyph to the top of the bounding box (vertical spae).  In layman's terms, there is a lot of white space in this font and that's the way it's been designed I suppose.  However, it appears some programs will remove this extra space when rendering the font but others dont.  So, I suppose my question boils down to, is there a way to determine how much white space is present and/or are there specific font metrics that specify this?  I've read through the online docs and have played with the api but was unable to find anything.  So my next approach was then to render a character using the gd library and see if I could detect the pixel width based on color.  Unfortunately it looks like the gd library that php is using is removing this padding and therefore my calculations are off.  Appreciate any help in this matter  Thanks very much, here is a simple text drawing of the space I'm trying to describe:


A  (space)
|    (space)
|    (space)
|     *
|     *
|     *
B    *

where b is the baseline, a the accent, and the *'s represent the actual glyph.  


Andreas


reply via email to

[Prev in Thread] Current Thread [Next in Thread]