freetype
[Top][All Lists]
Advanced

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

[Freetype] Re: [Devel] Text positioning problem


From: Werner LEMBERG
Subject: [Freetype] Re: [Devel] Text positioning problem
Date: Sun, 09 May 2004 09:30:32 +0200 (CEST)

> - How big is a text?    E.g. a 'A' ==> 12 px,  '_' ==> 1px

What exactly do you mean?  The vertical dimension of a single glyph?
This can be computed with FT_Outline_Get_BBox (in ftbbox.c; this
module is currently not compiled with the VisualC project files
delivered with FreeType 2.1.8 -- just add it if you need it).  A
quicker routine (which not necessarily gives the smallest BBox) is
FT_Outline_Get_CBox (or FT_Glyph_Get_CBox).

> - How big can all characters from a font be at maximum?   E.g. 18
> - How big is the maximum ascender in pixels for all characters in a font?
> - How big is the maximum descender in pixels for all characters in a font?

Unfortunately, this information isn't stored in all font formats.
Type 1 metric files have it, while many TrueType fonts lack this data.
In case the hdmx and vdmx tables are available, you can get this data
for selected pixel sizes.  Otherwise, you have to compute it by
yourself.  Using the above CBox functions should work quite quickly;
in combination with caching the glyphs you have no real delay.

> Btw, maybe we can talk by using ICQ / IRC?

Sorry, I'm working offline most of the time (sitting in a train from
Koblenz to Dortmund or vice versa).


    Werner



reply via email to

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