freetype
[Top][All Lists]
Advanced

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

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


From: Anson
Subject: [ft] scalable font metrics, ascent/descent/height, metrics struct
Date: Wed, 18 May 2005 17:48:57 +0100

Greetings to everyone.

I have a couple of questions on the font metrics.  I'm a complete
stranger to FreeType (and computer typography really.)  I have been
reading bits and pieces of FreeType and I couldn't still figure out
this rocket science.  :-(

All I'm trying to do is to read in a TTF file (hence scalable font?),
specify a required size in pixel, and determine some font metrics (as
opposed to individual glyph metrics) based on the required size.  Have
a look at the attached file.  All I need is to get those 22, 4, 6, 32
values (they may not be right as I didn't collect them based on all
glyphs in the font file.)

My first question is that if FreeType is capable to distinguish for
example 'A' from the 'A' with a circle/ascent?  What about characters
with descent?

Another question is on the source code.  If I want to get the font
metrics say for pixel size 30, I do:

FT_New_Face( ftLibrary, TheFontFile, 0, &ftFace );
FT_Set_Pixel_Sizes( ftFace, 30, 30 );

Now I get a metrics structure in ftFace->size->metrics and they are in
something called "26.6 frac. pixels".  I don't understand this very
well as they are in several thousands (more like vector coordinate)
instead of something close to 30.  How do these fractional pixels
related to the 30-pixel size?

My last question would be on the numerous metrics structures.  To my
understanding metrics in "FT_Face" is before scaled, whereas the
"FT_Size_Metrics" in a "ftFace->size->metrics" is scaled.  How are
they related to the metrics in a TT_Face structure?  Would one be more
accurate than the others?

I hope these questions are not bullocks and thanks for your time
reading them.  Any comments and helps would be gratefully received.

Millions thanks,
Anson

Attachment: FontMetrics.jpg
Description: JPEG image


reply via email to

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