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