]> git.sesse.net Git - casparcg/blob - SFML-1.6/extlibs/headers/freetype/ftbdf.h
(no commit message)
[casparcg] / SFML-1.6 / extlibs / headers / freetype / ftbdf.h
1 /***************************************************************************/
2 /*                                                                         */
3 /*  ftbdf.h                                                                */
4 /*                                                                         */
5 /*    FreeType API for accessing BDF-specific strings (specification).     */
6 /*                                                                         */
7 /*  Copyright 2002, 2003, 2004 by                                          */
8 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
9 /*                                                                         */
10 /*  This file is part of the FreeType project, and may only be used,       */
11 /*  modified, and distributed under the terms of the FreeType project      */
12 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
13 /*  this file you indicate that you have read the license and              */
14 /*  understand and accept it fully.                                        */
15 /*                                                                         */
16 /***************************************************************************/
17
18
19 #ifndef __FTBDF_H__
20 #define __FTBDF_H__
21
22 #include <ft2build.h>
23 #include FT_FREETYPE_H
24
25 #ifdef FREETYPE_H
26 #error "freetype.h of FreeType 1 has been loaded!"
27 #error "Please fix the directory search order for header files"
28 #error "so that freetype.h of FreeType 2 is found first."
29 #endif
30
31
32 FT_BEGIN_HEADER
33
34
35   /*************************************************************************/
36   /*                                                                       */
37   /* <Section>                                                             */
38   /*    bdf_fonts                                                          */
39   /*                                                                       */
40   /* <Title>                                                               */
41   /*    BDF Files                                                          */
42   /*                                                                       */
43   /* <Abstract>                                                            */
44   /*    BDF specific API.                                                  */
45   /*                                                                       */
46   /* <Description>                                                         */
47   /*    This section contains the declaration of BDF specific functions.   */
48   /*                                                                       */
49   /*************************************************************************/
50
51
52  /**********************************************************************
53   *
54   * @enum:
55   *    FT_PropertyType
56   *
57   * @description:
58   *    A list of BDF property types.
59   *
60   * @values:
61   *    BDF_PROPERTY_TYPE_NONE ::
62   *      Value 0 is used to indicate a missing property.
63   *
64   *    BDF_PROPERTY_TYPE_ATOM ::
65   *      Property is a string atom.
66   *
67   *    BDF_PROPERTY_TYPE_INTEGER ::
68   *      Property is a 32-bit signed integer.
69   *
70   *    BDF_PROPERTY_TYPE_CARDINAL ::
71   *      Property is a 32-bit unsigned integer.
72   */
73   typedef enum  BDF_PropertyType_
74   {
75     BDF_PROPERTY_TYPE_NONE     = 0,
76     BDF_PROPERTY_TYPE_ATOM     = 1,
77     BDF_PROPERTY_TYPE_INTEGER  = 2,
78     BDF_PROPERTY_TYPE_CARDINAL = 3
79
80   } BDF_PropertyType;
81
82
83  /**********************************************************************
84   *
85   * @type:
86   *    BDF_Property
87   *
88   * @description:
89   *    A handle to a @BDF_PropertyRec structure to model a given
90   *    BDF/PCF property.
91   */
92   typedef struct BDF_PropertyRec_*  BDF_Property;
93
94
95  /**********************************************************************
96   *
97   * @struct:
98   *    BDF_PropertyRec
99   *
100   * @description:
101   *    This structure models a given BDF/PCF property.
102   *
103   * @fields:
104   *    type ::
105   *      The property type.
106   *
107   *    u.atom ::
108   *      The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
109   *
110   *    u.integer ::
111   *      A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
112   *
113   *    u.cardinal ::
114   *      An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
115   */
116   typedef struct  BDF_PropertyRec_
117   {
118     BDF_PropertyType  type;
119     union {
120       const char*     atom;
121       FT_Int32        integer;
122       FT_UInt32       cardinal;
123
124     } u;
125
126   } BDF_PropertyRec;
127
128
129  /**********************************************************************
130   *
131   * @function:
132   *    FT_Get_BDF_Charset_ID
133   *
134   * @description:
135   *    Retrieves a BDF font character set identity, according to
136   *    the BDF specification.
137   *
138   * @input:
139   *    face ::
140   *       A handle to the input face.
141   *
142   * @output:
143   *    acharset_encoding ::
144   *       Charset encoding, as a C string, owned by the face.
145   *
146   *    acharset_registry ::
147   *       Charset registry, as a C string, owned by the face.
148   *
149   * @return:
150   *   FreeType error code.  0 means success.
151   *
152   * @note:
153   *   This function only works with BDF faces, returning an error otherwise.
154   */
155   FT_EXPORT( FT_Error )
156   FT_Get_BDF_Charset_ID( FT_Face       face,
157                          const char*  *acharset_encoding,
158                          const char*  *acharset_registry );
159
160
161  /**********************************************************************
162   *
163   * @function:
164   *    FT_Get_BDF_Property
165   *
166   * @description:
167   *    Retrieves a BDF property from a BDF or PCF font file.
168   *
169   * @input:
170   *    face :: A handle to the input face.
171   *
172   *    name :: The property name.
173   *
174   * @output:
175   *    aproperty :: The property.
176   *
177   * @return:
178   *   FreeType error code.  0 means success.
179   *
180   * @note:
181   *   This function works with BDF _and_ PCF fonts.  It returns an error
182   *   otherwise.  It also returns an error if the property is not in the
183   *   font.
184   *
185   *   In case of error, "aproperty->type" is always set to
186   *   @BDF_PROPERTY_TYPE_NONE.
187   */
188   FT_EXPORT( FT_Error )
189   FT_Get_BDF_Property( FT_Face           face,
190                        const char*       prop_name,
191                        BDF_PropertyRec  *aproperty );
192
193  /* */
194
195 FT_END_HEADER
196
197 #endif /* __FTBDF_H__ */
198
199
200 /* END */