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 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 specification 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 typedef struct FT_SfntName_
97 FT_UShort platform_id;
98 FT_UShort encoding_id;
99 FT_UShort language_id;
102 FT_Byte* string; /* this string is *not* null-terminated! */
103 FT_UInt string_len; /* in bytes */
108 /*************************************************************************/
111 /* FT_Get_Sfnt_Name_Count */
114 /* Retrieves the number of name strings in the SFNT `name' table. */
117 /* face :: A handle to the source face. */
120 /* The number of strings in the `name' table. */
123 FT_Get_Sfnt_Name_Count( FT_Face face );
126 /*************************************************************************/
129 /* FT_Get_Sfnt_Name */
132 /* Retrieves a string of the SFNT `name' table for a given index. */
135 /* face :: A handle to the source face. */
137 /* idx :: The index of the `name' string. */
140 /* aname :: The indexed FT_SfntName structure. */
143 /* FreeType error code. 0 means success. */
146 /* The `string' array returned in the `aname' structure is not */
147 /* null-terminated. */
149 /* Use FT_Get_Sfnt_Name_Count() to get the total number of available */
150 /* `name' table entries, then do a loop until you get the right */
151 /* platform, encoding, and name ID. */
153 FT_EXPORT( FT_Error )
154 FT_Get_Sfnt_Name( FT_Face face,
156 FT_SfntName *aname );
164 #endif /* __FT_SFNT_NAMES_H__ */