freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] How can extract the outline from FT_GlyphSlotRec?


From: Vincent Caron
Subject: Re: [Devel] How can extract the outline from FT_GlyphSlotRec?
Date: 11 Jul 2002 03:32:54 +0200

On Thu, 2002-07-11 at 00:58, net pl wrote:
> Hi,
> I saw that to extract a glyph image from the FT_GlyphSlotRec, I can use the 
> FT_Get_Glyph(..). And for the glyph outline, is there a similar function?

It turns out that a FT_Glyph/FT_GlyphSlot object can store either
outline or bitmap information (but not both at the same time). You can
check which kind is your FT_Glyph by accessing its 'format' field, which
will mostly be ft_glyph_format_bitmap or ft_glyph_format_outline (you
have some other glyph tastes though).

To get the right kind of glyph, you must take care of this at load time.
FT_Load_Glyph() will load a glyph using its native format when the
FT_LOAD_DEFAULT flag is used : that is 'outline' for TrueType or Type1
fonts, 'bitmaps' for PCF, and so on. You can fetch a glyph as a bitmap
either by loading with FT_LOAD_RENDER, or calling FT_Render_Glyph() on
at outline glyphslot.

Hope this make things clearer. Needless to say I spared some gory
details like embedded bitmaps, etc :)





reply via email to

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