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