update for HEAD-2003050101
[reactos.git] / lib / freetype / include / freetype / ftbdf.h
1 /***************************************************************************/
2 /*                                                                         */
3 /*  ftbdf.h                                                                */
4 /*                                                                         */
5 /*    FreeType API for accessing BDF-specific strings (specification).     */
6 /*                                                                         */
7 /*  Copyright 2002 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
26 FT_BEGIN_HEADER
27
28
29   /*************************************************************************/
30   /*                                                                       */
31   /* <Section>                                                             */
32   /*    bdf_fonts                                                          */
33   /*                                                                       */
34   /* <Title>                                                               */
35   /*    BDF Fonts                                                          */
36   /*                                                                       */
37   /* <Abstract>                                                            */
38   /*    BDF-specific APIs                                                  */
39   /*                                                                       */
40   /* <Description>                                                         */
41   /*    This section contains the declaration of BDF-specific functions.   */
42   /*                                                                       */
43   /*************************************************************************/
44
45
46  /**********************************************************************
47   *
48   * @enum:
49   *    FT_PropertyType
50   *
51   * @description:
52   *    list of BDF property types
53   *
54   * @values:
55   *    BDF_PROPERTY_TYPE_NONE ::
56   *      value 0 is used to indicate a missing property
57   *
58   *    BDF_PROPERTY_TYPE_ATOM ::
59   *      property is a string atom
60   *
61   *    BDF_PROPERTY_TYPE_INTEGER ::
62   *      property is a 32-bit signed integer
63   *
64   *    BDF_PROPERTY_TYPE_CARDINAL ::
65   *      property is a 32-bit unsigned integer
66   */
67   typedef enum
68   {
69     BDF_PROPERTY_TYPE_NONE     = 0,
70     BDF_PROPERTY_TYPE_ATOM     = 1,
71     BDF_PROPERTY_TYPE_INTEGER  = 2,
72     BDF_PROPERTY_TYPE_CARDINAL = 3
73
74   } BDF_PropertyType;
75
76
77  /**********************************************************************
78   *
79   * @type:  BDF_Property
80   *
81   * @description:
82   *    handle to a @BDF_PropertyRec structure used to model a given
83   *    BDF/PCF property
84   */
85   typedef struct BDF_PropertyRec_*   BDF_Property;
86
87  /**********************************************************************
88   *
89   * @struct:  BDF_PropertyRec
90   *
91   * @description:
92   *    models a given BDF/PCF property
93   *
94   * @note:
95   *    type       :: property type
96   *    u.atom     :: atom string, when type is @BDF_PROPERTY_TYPE_ATOM
97   *    u.integer  :: signed integer, when type is @BDF_PROPERTY_TYPE_INTEGER
98   *    u.cardinal :: unsigned integer, when type is @BDF_PROPERTY_TYPE_CARDINAL
99   */
100   typedef struct BDF_PropertyRec_
101   {
102     BDF_PropertyType   type;
103     union {
104       const char*   atom;
105       FT_Int32      integer;
106       FT_UInt32     cardinal;
107
108     } u;
109
110   } BDF_PropertyRec;
111
112
113  /**********************************************************************
114   *
115   * @function:
116   *    FT_Get_BDF_Charset_ID
117   *
118   * @description:
119   *    Retrieves a BDF font character set identity, according to
120   *    the BDF specification.
121   *
122   * @input:
123   *    face ::
124   *       handle to input face
125   *
126   * @output:
127   *    acharset_encoding ::
128   *       Charset encoding, as a C string, owned by the face.
129   *
130   *    acharset_registry ::
131   *       Charset registry, as a C string, owned by the face.
132   *
133   * @return:
134   *   FreeType rror code.  0 means success.
135   *
136   * @note:
137   *   This function only works with BDF faces, returning an error otherwise.
138   */
139   FT_EXPORT( FT_Error )
140   FT_Get_BDF_Charset_ID( FT_Face       face,
141                          const char*  *acharset_encoding,
142                          const char*  *acharset_registry );
143
144  /**********************************************************************
145   *
146   * @function:
147   *    FT_Get_BDF_Property
148   *
149   * @description:
150   *    Retrieves a BDF property from a BDF or PCF font file
151   *
152   * @input:
153   *    face :: handle to input face
154   *    name :: property name
155   *
156   * @output:
157   *    aproperty :: the property
158   *
159   * @return:
160   *   FreeType error code.  0 means success.
161   *
162   * @note:
163   *   This function works with BDF _and_ PCF fonts. It returns an error
164   *   otherwise. it also returns an error when the property is not in the
165   *   font.
166   *
167   *   in case of error, "aproperty->type" is always set to
168   *   @BDF_PROPERTY_TYPE_NONE
169   */
170   FT_EXPORT( FT_Error )
171   FT_Get_BDF_Property( FT_Face           face,
172                        const char*       prop_name,
173                        BDF_PropertyRec  *aproperty );
174
175  /* */
176
177 FT_END_HEADER
178
179 #endif /* __FTBDF_H__ */
180
181
182 /* END */