Defined in FT_FREETYPE_H (freetype/freetype.h).
|
typedef enum FT_Encoding_
{
FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ),
FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ),
FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ),
FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ),
FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ),
/* for backwards compatibility */
FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS,
FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312,
FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5,
FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB,
FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ),
FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ),
FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ),
FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
} FT_Encoding;
|
An enumeration used to specify character sets supported by charmaps. Used in the FT_Select_Charmap API function.
|
note |
Despite the name, this enumeration lists specific character repertories (i.e., charsets), and not text encoding methods (e.g., UTF-8, UTF-16, etc.).
Other encodings might be defined in the future.
|
values |
FT_ENCODING_NONE |
The encoding value 0 is reserved.
|
FT_ENCODING_UNICODE |
Corresponds to the Unicode character set. This value covers all versions of the Unicode repertoire, including ASCII and Latin-1. Most fonts include a Unicode charmap, but not all of them.
For example, if you want to access Unicode value U+1F028 (and the font contains it), use value 0x1F028 as the input value for FT_Get_Char_Index.
|
FT_ENCODING_MS_SYMBOL |
Corresponds to the Microsoft Symbol encoding, used to encode mathematical symbols in the 32..255 character code range. For more information, see ‘http://www.ceviz.net/symbol.htm’.
|
FT_ENCODING_SJIS |
Corresponds to Japanese SJIS encoding. More info at at ‘http://langsupport.japanreference.com/encoding.shtml’. See note on multi-byte encodings below.
|
FT_ENCODING_GB2312 |
Corresponds to an encoding system for Simplified Chinese as used used in mainland China.
|
FT_ENCODING_BIG5 |
Corresponds to an encoding system for Traditional Chinese as used in Taiwan and Hong Kong.
|
FT_ENCODING_WANSUNG |
Corresponds to the Korean encoding system known as Wansung. For more information see ‘http://www.microsoft.com/typography/unicode/949.txt’.
|
FT_ENCODING_JOHAB |
The Korean standard character set (KS C 5601-1992), which corresponds to MS Windows code page 1361. This character set includes all possible Hangeul character combinations.
|
FT_ENCODING_ADOBE_LATIN_1 |
|
Corresponds to a Latin-1 encoding as defined in a Type 1 PostScript font. It is limited to 256 character codes.
|
FT_ENCODING_ADOBE_STANDARD |
|
Corresponds to the Adobe Standard encoding, as found in Type 1, CFF, and OpenType/CFF fonts. It is limited to 256 character codes.
|
FT_ENCODING_ADOBE_EXPERT |
|
Corresponds to the Adobe Expert encoding, as found in Type 1, CFF, and OpenType/CFF fonts. It is limited to 256 character codes.
|
FT_ENCODING_ADOBE_CUSTOM |
|
Corresponds to a custom encoding, as found in Type 1, CFF, and OpenType/CFF fonts. It is limited to 256 character codes.
|
FT_ENCODING_APPLE_ROMAN |
|
Corresponds to the 8-bit Apple roman encoding. Many TrueType and OpenType fonts contain a charmap for this encoding, since older versions of Mac OS are able to use it.
|
FT_ENCODING_OLD_LATIN_2 |
|
This value is deprecated and was never used nor reported by FreeType. Don't use or test for it.
|
FT_ENCODING_MS_SJIS |
Same as FT_ENCODING_SJIS. Deprecated.
|
FT_ENCODING_MS_GB2312 |
Same as FT_ENCODING_GB2312. Deprecated.
|
FT_ENCODING_MS_BIG5 |
Same as FT_ENCODING_BIG5. Deprecated.
|
FT_ENCODING_MS_WANSUNG |
Same as FT_ENCODING_WANSUNG. Deprecated.
|
FT_ENCODING_MS_JOHAB |
Same as FT_ENCODING_JOHAB. Deprecated.
|
|
note |
By default, FreeType automatically synthesizes a Unicode charmap for PostScript fonts, using their glyph names dictionaries. However, it also reports the encodings defined explicitly in the font file, for the cases when they are needed, with the Adobe values as well.
FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap is neither Unicode nor ISO-8859-1 (otherwise it is set to FT_ENCODING_UNICODE). Use FT_Get_BDF_Charset_ID to find out which encoding is really present. If, for example, the ‘cs_registry’ field is ‘KOI8’ and the ‘cs_encoding’ field is ‘R’, the font is encoded in KOI8-R.
FT_ENCODING_NONE is always set (with a single exception) by the winfonts driver. Use FT_Get_WinFNT_Header and examine the ‘charset’ field of the FT_WinFNT_HeaderRec structure to find out which encoding is really present. For example, FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for Russian).
FT_ENCODING_NONE is set if ‘platform_id’ is TT_PLATFORM_MACINTOSH and ‘encoding_id’ is not TT_MAC_ID_ROMAN (otherwise it is set to FT_ENCODING_APPLE_ROMAN).
If ‘platform_id’ is TT_PLATFORM_MACINTOSH, use the function FT_Get_CMap_Language_ID to query the Mac language ID which may be needed to be able to distinguish Apple encoding variants. See
http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT
to get an idea how to do that. Basically, if the language ID is 0, don't use it, otherwise subtract 1 from the language ID. Then examine ‘encoding_id’. If, for example, ‘encoding_id’ is TT_MAC_ID_ROMAN and the language ID (minus 1) is ‘TT_MAC_LANGID_GREEK’, it is the Greek encoding, not Roman. TT_MAC_ID_ARABIC with ‘TT_MAC_LANGID_FARSI’ means the Farsi variant the Arabic encoding.
|
|