freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] Question about FreeType 2


From: Vincent Caron
Subject: Re: [Devel] Question about FreeType 2
Date: Thu, 14 Nov 2002 00:01:55 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020913 Debian/1.1-1

address@hidden wrote:
Can I access the glyphs in the TrueType face by unicode and not by
character code?

Font files have 'charmaps' which provide a conversion from a given encoding (Unicode, KOI8, GB2312, etc) to its internal glyph indexes. FT_Load_Char() will load a char using the currently selected charmap. It means that you must know which charmap is currently used. Font files can embed multiple charmaps. It is useful to know that the TrueType loader (and maybe others ?) automatically select the Unicode charmap if there's one.

You can use the 'ftdump' program bundled in ft2demos to display the available charmaps from a font file (however it shows cryptic numbers). See FT_Select_Charmap() and the 'charmaps' field of FT_FaceRec.

http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_Select_Charmap
http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_FaceRec


What encoding does FT_Load_Char(..) assume for character code? 7-bit
ASCII/8-bit ASCII?

It uses the input encoding of the currently selected charmap. Since FT_ULong is 32bit under 32bit platforms, it expects UCS4 when the charmap is a Unicode one.




reply via email to

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