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 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
33 /*************************************************************************/
42 /* Access the names embedded in TrueType and OpenType files. */
45 /* The TrueType and OpenType specification allow the inclusion of */
46 /* a special `names table' in font files. This table contains */
47 /* textual (and internationalized) information regarding the font, */
48 /* like family name, copyright, version, etc. */
50 /* The definitions below are used to access them if available. */
52 /* Note that this has nothing to do with glyph names! */
54 /*************************************************************************/
57 /*************************************************************************/
63 /* A structure used to model an SFNT `name' table entry. */
66 /* platform_id :: The platform ID for `string'. */
68 /* encoding_id :: The encoding ID for `string'. */
70 /* language_id :: The language ID for `string'. */
72 /* name_id :: An identifier for `string'. */
74 /* string :: The `name' string. Note that its format differs */
75 /* depending on the (platform,encoding) pair. It can */
76 /* be a Pascal String, a UTF-16 one, etc.. */
78 /* Generally speaking, the string is not */
79 /* zero-terminated. Please refer to the TrueType */
80 /* specification for details.. */
82 /* string_len :: The length of `string' in bytes. */
85 /* Possible values for `platform_id', `encoding_id', `language_id', */
86 /* and `name_id' are given in the file `ttnameid.h'. For details */
87 /* please refer to the TrueType or OpenType specification. */
89 typedef struct FT_SfntName_
91 FT_UShort platform_id;
92 FT_UShort encoding_id;
93 FT_UShort language_id;
96 FT_Byte* string; /* this string is *not* null-terminated! */
97 FT_UInt string_len; /* in bytes */
102 /*************************************************************************/
105 /* FT_Get_Sfnt_Name_Count */
108 /* Retrieves the number of name strings in the SFNT `name' table. */
111 /* face :: A handle to the source face. */
114 /* The number of strings in the `name' table. */
117 FT_Get_Sfnt_Name_Count( FT_Face face );
120 /*************************************************************************/
123 /* FT_Get_Sfnt_Name */
126 /* Retrieves a string of the SFNT `name' table for a given index. */
129 /* face :: A handle to the source face. */
131 /* index :: The index of the `name' string. */
134 /* aname :: The indexed FT_SfntName structure. */
137 /* FreeType error code. 0 means success. */
140 /* The `string' array returned in the `aname' structure is not */
141 /* null-terminated. */
143 /* Use FT_Get_Sfnt_Name_Count() to get the total number of available */
144 /* `name' table entries, then do a loop until you get the right */
145 /* platform, encoding, and name ID. */
147 FT_EXPORT( FT_Error )
148 FT_Get_Sfnt_Name( FT_Face face,
150 FT_SfntName *aname );
158 #endif /* __FT_SFNT_NAMES_H__ */