The BIG graph update
[rrdtool.git] / libraries / freetype-2.0.5 / include / freetype / ftsnames.h
1 /***************************************************************************/
2 /*                                                                         */
3 /*  ftsnames.h                                                             */
4 /*                                                                         */
5 /*    Simple interface to access SFNT name tables (which are used          */
6 /*    to hold font names, copyright info, notices, etc.) (specification).  */
7 /*                                                                         */
8 /*    This is _not_ used to retrieve glyph names!                          */
9 /*                                                                         */
10 /*  Copyright 1996-2001 by                                                 */
11 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
12 /*                                                                         */
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.                                        */
18 /*                                                                         */
19 /***************************************************************************/
20
21
22 #ifndef __FT_SFNT_NAMES_H__
23 #define __FT_SFNT_NAMES_H__
24
25
26 #include <ft2build.h>
27 #include FT_FREETYPE_H
28
29
30 FT_BEGIN_HEADER
31
32
33   /*************************************************************************/
34   /*                                                                       */
35   /* <Section>                                                             */
36   /*    sfnt_names                                                         */
37   /*                                                                       */
38   /* <Title>                                                               */
39   /*    SFNT Names                                                         */
40   /*                                                                       */
41   /* <Abstract>                                                            */
42   /*    Access the names embedded in TrueType and OpenType files.          */
43   /*                                                                       */
44   /* <Description>                                                         */
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.                         */
49   /*                                                                       */
50   /*    The definitions below are used to access them if available.        */
51   /*                                                                       */
52   /*    Note that this has nothing to do with glyph names!                 */
53   /*                                                                       */
54   /*************************************************************************/
55
56
57   /*************************************************************************/
58   /*                                                                       */
59   /* <Struct>                                                              */
60   /*    FT_SfntName                                                        */
61   /*                                                                       */
62   /* <Description>                                                         */
63   /*    A structure used to model an SFNT `name' table entry.              */
64   /*                                                                       */
65   /* <Fields>                                                              */
66   /*    platform_id :: The platform ID for `string'.                       */
67   /*                                                                       */
68   /*    encoding_id :: The encoding ID for `string'.                       */
69   /*                                                                       */
70   /*    language_id :: The language ID for `string'.                       */
71   /*                                                                       */
72   /*    name_id     :: An identifier for `string'.                         */
73   /*                                                                       */
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..             */
77   /*                                                                       */
78   /*                   Generally speaking, the string is not               */
79   /*                   zero-terminated. Please refer to the TrueType       */
80   /*                   specification for details..                         */
81   /*                                                                       */
82   /*    string_len  :: The length of `string' in bytes.                    */
83   /*                                                                       */
84   /* <Note>                                                                */
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.            */
88   /*                                                                       */
89   typedef struct  FT_SfntName_
90   {
91     FT_UShort  platform_id;
92     FT_UShort  encoding_id;
93     FT_UShort  language_id;
94     FT_UShort  name_id;
95
96     FT_Byte*   string;      /* this string is *not* null-terminated! */
97     FT_UInt    string_len;  /* in bytes */
98
99   } FT_SfntName;
100
101
102   /*************************************************************************/
103   /*                                                                       */
104   /* <Function>                                                            */
105   /*    FT_Get_Sfnt_Name_Count                                             */
106   /*                                                                       */
107   /* <Description>                                                         */
108   /*    Retrieves the number of name strings in the SFNT `name' table.     */
109   /*                                                                       */
110   /* <Input>                                                               */
111   /*    face :: A handle to the source face.                               */
112   /*                                                                       */
113   /* <Return>                                                              */
114   /*    The number of strings in the `name' table.                         */
115   /*                                                                       */
116   FT_EXPORT( FT_UInt )
117   FT_Get_Sfnt_Name_Count( FT_Face  face );
118
119
120   /*************************************************************************/
121   /*                                                                       */
122   /* <Function>                                                            */
123   /*    FT_Get_Sfnt_Name                                                   */
124   /*                                                                       */
125   /* <Description>                                                         */
126   /*    Retrieves a string of the SFNT `name' table for a given index.     */
127   /*                                                                       */
128   /* <Input>                                                               */
129   /*    face  :: A handle to the source face.                              */
130   /*                                                                       */
131   /*    index :: The index of the `name' string.                           */
132   /*                                                                       */
133   /* <Output>                                                              */
134   /*    aname :: The indexed FT_SfntName structure.                        */
135   /*                                                                       */
136   /* <Return>                                                              */
137   /*    FreeType error code.  0 means success.                             */
138   /*                                                                       */
139   /* <Note>                                                                */
140   /*    The `string' array returned in the `aname' structure is not        */
141   /*    null-terminated.                                                   */
142   /*                                                                       */
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.                                   */
146   /*                                                                       */
147   FT_EXPORT( FT_Error )
148   FT_Get_Sfnt_Name( FT_Face       face,
149                     FT_UInt       index,
150                     FT_SfntName  *aname );
151
152
153   /* */
154
155
156 FT_END_HEADER
157
158 #endif /* __FT_SFNT_NAMES_H__ */
159
160
161 /* END */