freetype
[Top][All Lists]
Advanced

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

Re: [ft] scalable font metrics, ascent/descent/height, metrics struct


From: Anson
Subject: Re: [ft] scalable font metrics, ascent/descent/height, metrics struct
Date: Wed, 25 May 2005 17:39:15 +0100

Thanks for your response Werner.  I thought you pointed me to the
OpenType specification but I didn't know there is a page for
recommendation.  My fault.

I have compiled a file documenting different metrics I have come
across (see attached rtf.)  As far as I can tell all metrics (except
usWinAscent and usWinDescent) are defined on *all* glyphs on the font
file.  I have 2 questions in mind:

1. What is the best way to get the ascent and descent values for Latin
characters?  (effectively 'A' to 'Z' and 'a' to 'z'.)

2. What is "AFM file" as mentioned in sTypoAscender and sTypoDescender
documentation?

Thanks again,
Anson

On 5/25/05, Werner LEMBERG <address@hidden> wrote:
> 
> > By far I have found 3 sets of ascent/descent/height metrics.  We
> > have ascender/descender/height from FT_Face.  We have
> > ascender/descender/height from FT_Size_Metrics.  We also have
> > sTypoAscender/sTypoDescender from TT_Face.  How do they differ from
> > each other?
> 
> You haven't yet read the documentation files I've pointed to, right?
> 
> From http://www.microsoft.com/OpenType/OTSpec/recom.htm:
> 
>  sTypoAscender is used to determine the optimum offset from the top
>  of a text frame to the first baseline.  sTypoDescender is used to
>  determine the optimum offset from the last baseline to the bottom of
>  the text frame.  The value of (sTypoAscender - sTypoDescender) is
>  recommended to equal one em.  [...]
> 
>  For Western fonts, the Ascender and Descender fields in Type 1
>  fonts' AFM files are a good source of sTypoAscender and
>  sTypoDescender, respectively.  The Minion Pro font family (designed
>  on a 1000-unit em), for example, sets sTypoAscender = 727 and
>  sTypoDescender = -273.
> 
>  sTypoAscender, sTypoDescender and sTypoLineGap specify the
>  recommended line spacing for single-spaced horizontal text.  The
>  baseline-to-baseline value is expressed by:
> 
>    OS/2.sTypoAscender - OS/2.sTypoDescender + OS/2.sTypoLineGap
> 
>  sTypoLineGap will usually be set by the font developer such that the
>  value of the above expression is approximately 120% of the em.  The
>  application can use this value as the default horizontal line
>  spacing.  The Minion Pro font family (designed on a 1000-unit em),
>  for example, sets sTypoLineGap = 200.
> 
> On this page you find more details how the various metrics data
> *within an OpenType file* differ.
> 
> A complete description of FreeType's glyph metrics can be found at
> http://freetype.freedesktop.org/freetype2/docs/glyphs/glyphs-3.html.
> In case this file doesn't explain everything, it is a bug in the
> documentation, and I ask you to send questions (again) to the
> freetype-devel list so that it is going to be fixed.
> 
> 
>    Werner

Attachment: Metrics.rtf
Description: Text Data


reply via email to

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