1 /***************************************************************************/
5 /* Simple interface to access SFNT name tables (which are used */
6 /* to hold font names, copyright info, notices, etc.) (specification). */
8 /* This is _not_ used to retrieve glyph names! */
10 /* Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by */
11 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
13 /* This file is part of the FreeType project, and may only be used, */
14 /* modified, and distributed under the terms of the FreeType project */
15 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
16 /* this file you indicate that you have read the license and */
17 /* understand and accept it fully. */
19 /***************************************************************************/
22 #ifndef __FT_SFNT_NAMES_H__
23 #define __FT_SFNT_NAMES_H__
27 #include FT_FREETYPE_H
30 #error "freetype.h of FreeType 1 has been loaded!"
31 #error "Please fix the directory search order for header files"
32 #error "so that freetype.h of FreeType 2 is found first."
39 /*************************************************************************/
48 /* Access the names embedded in TrueType and OpenType files. */
51 /* The TrueType and OpenType specifications allow the inclusion of */
52 /* a special `names table' in font files. This table contains */
53 /* textual (and internationalized) information regarding the font, */
54 /* like family name, copyright, version, etc. */
56 /* The definitions below are used to access them if available. */
58 /* Note that this has nothing to do with glyph names! */
60 /*************************************************************************/
63 /*************************************************************************/
69 /* A structure used to model an SFNT `name' table entry. */
72 /* platform_id :: The platform ID for `string'. */
74 /* encoding_id :: The encoding ID for `string'. */
76 /* language_id :: The language ID for `string'. */
78 /* name_id :: An identifier for `string'. */
80 /* string :: The `name' string. Note that its format differs */
81 /* depending on the (platform,encoding) pair. It can */
82 /* be a Pascal String, a UTF-16 one, etc. */
84 /* Generally speaking, the string is not */
85 /* zero-terminated. Please refer to the TrueType */
86 /* specification for details. */
88 /* string_len :: The length of `string' in bytes. */
91 /* Possible values for `platform_id', `encoding_id', `language_id', */
92 /* and `name_id' are given in the file `ttnameid.h'. For details */
93 /* please refer to the TrueType or OpenType specification. */
95 /* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
96 /* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */
98 typedef struct FT_SfntName_
100 FT_UShort platform_id;
101 FT_UShort encoding_id;
102 FT_UShort language_id;
105 FT_Byte* string; /* this string is *not* null-terminated! */
106 FT_UInt string_len; /* in bytes */
111 /*************************************************************************/
114 /* FT_Get_Sfnt_Name_Count */
117 /* Retrieve the number of name strings in the SFNT `name' table. */
120 /* face :: A handle to the source face. */
123 /* The number of strings in the `name' table. */
126 FT_Get_Sfnt_Name_Count( FT_Face face );
129 /*************************************************************************/
132 /* FT_Get_Sfnt_Name */
135 /* Retrieve a string of the SFNT `name' table for a given index. */
138 /* face :: A handle to the source face. */
140 /* idx :: The index of the `name' string. */
143 /* aname :: The indexed @FT_SfntName structure. */
146 /* FreeType error code. 0~means success. */
149 /* The `string' array returned in the `aname' structure is not */
150 /* null-terminated. The application should deallocate it if it is no */
153 /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
154 /* `name' table entries, then do a loop until you get the right */
155 /* platform, encoding, and name ID. */
157 FT_EXPORT( FT_Error )
158 FT_Get_Sfnt_Name( FT_Face face,
160 FT_SfntName *aname );
163 /***************************************************************************
166 * FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
169 * A constant used as the tag of @FT_Parameter structures to make
170 * FT_Open_Face() ignore preferred family subfamily names in `name'
171 * table since OpenType version 1.4. For backwards compatibility with
172 * legacy systems which has 4-face-per-family restriction.
175 #define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
178 /***************************************************************************
181 * FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY
184 * A constant used as the tag of @FT_Parameter structures to make
185 * FT_Open_Face() ignore preferred subfamily names in `name' table since
186 * OpenType version 1.4. For backwards compatibility with legacy
187 * systems which has 4-face-per-family restriction.
190 #define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' )
197 #endif /* __FT_SFNT_NAMES_H__ */