FreeType-2.1.10 API Reference
SFNT Names
Synopsis
#FT_SfntName
FT_SfntName
#FT_Get_Sfnt_Name_Count
FT_Get_Sfnt_Name_Count
#FT_Get_Sfnt_Name
FT_Get_Sfnt_Name
The TrueType and OpenType specification allow the inclusion of a special `names table' in font files. This table contains textual (and internationalized) information regarding the font, like family name, copyright, version, etc.
The definitions below are used to access them if available.
Note that this has nothing to do with glyph names!
FT_SfntName
typedef
struct
FT_SfntName_
{
ft2-basic_types.html#FT_UShort
FT_UShort
platform_id;
ft2-basic_types.html#FT_UShort
FT_UShort
encoding_id;
ft2-basic_types.html#FT_UShort
FT_UShort
language_id;
ft2-basic_types.html#FT_UShort
FT_UShort
name_id;
ft2-basic_types.html#FT_Byte
FT_Byte
*   string;      /* this string is *not* null-terminated! */
ft2-basic_types.html#FT_UInt
FT_UInt
string_len;  /* in bytes */
}
FT_SfntName
;
A structure used to model an SFNT `name' table entry.
fields
platform_id
The platform ID for `string'.
encoding_id
The encoding ID for `string'.
language_id
The language ID for `string'.
name_id
An identifier for `string'.
string
The `name' string. Note that its format differs depending on the (platform,encoding) pair. It can be a Pascal String, a UTF-16 one, etc..
Generally speaking, the string is not zero-terminated. Please refer to the TrueType specification for details..
string_len
The length of `string' in bytes.
note
Possible values for `platform_id', `encoding_id', `language_id', and `name_id' are given in the file `ttnameid.h'. For details please refer to the TrueType or OpenType specification.
FT_Get_Sfnt_Name_Count
FT_EXPORT(
ft2-basic_types.html#FT_UInt
FT_UInt
)
FT_Get_Sfnt_Name_Count
(
ft2-base_interface.html#FT_Face
FT_Face
face );
Retrieves the number of name strings in the SFNT `name' table.
input
face
A handle to the source face.
return
The number of strings in the `name' table.
FT_Get_Sfnt_Name
FT_EXPORT(
ft2-basic_types.html#FT_Error
FT_Error
)
FT_Get_Sfnt_Name
(
ft2-base_interface.html#FT_Face
FT_Face
face,
ft2-basic_types.html#FT_UInt
FT_UInt
idx,
ft2-sfnt_names.html#FT_SfntName
FT_SfntName
*aname );
Retrieves a string of the SFNT `name' table for a given index.
input
face
A handle to the source face.
idx
The index of the `name' string.
output
aname
The indexed FT_SfntName structure.
return
FreeType error code. 0 means success.
note
The `string' array returned in the `aname' structure is not null-terminated.
Use FT_Get_Sfnt_Name_Count() to get the total number of available `name' table entries, then do a loop until you get the right platform, encoding, and name ID.
