ReactOS 0.4.16-dev-1078-g21d3e29
pcf.h
Go to the documentation of this file.
1/* pcf.h
2
3 FreeType font driver for pcf fonts
4
5 Copyright (C) 2000, 2001, 2002, 2003, 2006, 2010 by
6 Francesco Zappa Nardelli
7
8Permission is hereby granted, free of charge, to any person obtaining a copy
9of this software and associated documentation files (the "Software"), to deal
10in the Software without restriction, including without limitation the rights
11to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12copies of the Software, and to permit persons to whom the Software is
13furnished to do so, subject to the following conditions:
14
15The above copyright notice and this permission notice shall be included in
16all copies or substantial portions of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24THE SOFTWARE.
25*/
26
27
28#ifndef PCF_H_
29#define PCF_H_
30
31
32#include <ft2build.h>
33#include FT_INTERNAL_DRIVER_H
34#include FT_INTERNAL_STREAM_H
35
36
38
39 typedef struct PCF_TableRec_
40 {
45
47
48
49 typedef struct PCF_TocRec_
50 {
54
56
57
58 typedef struct PCF_ParsePropertyRec_
59 {
63
65
66
67 typedef struct PCF_PropertyRec_
68 {
71
72 union
73 {
77
79
81
82
84 {
90
92
93
94 typedef struct PCF_MetricRec_
95 {
103
105
106
107 typedef struct PCF_EncRec_
108 {
114
116
118
119
120 typedef struct PCF_AccelRec_
121 {
136
138
139
140 /*
141 * This file uses X11 terminology for PCF data; an `encoding' in X11 speak
142 * is the same as a `character code' in FreeType speak.
143 */
144 typedef struct PCF_FaceRec_
145 {
147
150
153
156
159
162
164
166
168
169
170 typedef struct PCF_DriverRec_
171 {
173
175
177
178
179 /* macros for pcf font format */
180
181#define LSBFirst 0
182#define MSBFirst 1
183
184#define PCF_FILE_VERSION ( ( 'p' << 24 ) | \
185 ( 'c' << 16 ) | \
186 ( 'f' << 8 ) | 1 )
187#define PCF_FORMAT_MASK 0xFFFFFF00UL
188
189#define PCF_DEFAULT_FORMAT 0x00000000UL
190#define PCF_INKBOUNDS 0x00000200UL
191#define PCF_ACCEL_W_INKBOUNDS 0x00000100UL
192#define PCF_COMPRESSED_METRICS 0x00000100UL
193
194#define PCF_FORMAT_MATCH( a, b ) \
195 ( ( (a) & PCF_FORMAT_MASK ) == ( (b) & PCF_FORMAT_MASK ) )
196
197#define PCF_GLYPH_PAD_MASK ( 3 << 0 )
198#define PCF_BYTE_MASK ( 1 << 2 )
199#define PCF_BIT_MASK ( 1 << 3 )
200#define PCF_SCAN_UNIT_MASK ( 3 << 4 )
201
202#define PCF_BYTE_ORDER( f ) \
203 ( ( (f) & PCF_BYTE_MASK ) ? MSBFirst : LSBFirst )
204#define PCF_BIT_ORDER( f ) \
205 ( ( (f) & PCF_BIT_MASK ) ? MSBFirst : LSBFirst )
206#define PCF_GLYPH_PAD_INDEX( f ) \
207 ( (f) & PCF_GLYPH_PAD_MASK )
208#define PCF_GLYPH_PAD( f ) \
209 ( 1 << PCF_GLYPH_PAD_INDEX( f ) )
210#define PCF_SCAN_UNIT_INDEX( f ) \
211 ( ( (f) & PCF_SCAN_UNIT_MASK ) >> 4 )
212#define PCF_SCAN_UNIT( f ) \
213 ( 1 << PCF_SCAN_UNIT_INDEX( f ) )
214#define PCF_FORMAT_BITS( f ) \
215 ( (f) & ( PCF_GLYPH_PAD_MASK | \
216 PCF_BYTE_MASK | \
217 PCF_BIT_MASK | \
218 PCF_SCAN_UNIT_MASK ) )
219
220#define PCF_SIZE_TO_INDEX( s ) ( (s) == 4 ? 2 : (s) == 2 ? 1 : 0 )
221#define PCF_INDEX_TO_SIZE( b ) ( 1 << b )
222
223#define PCF_FORMAT( bit, byte, glyph, scan ) \
224 ( ( PCF_SIZE_TO_INDEX( scan ) << 4 ) | \
225 ( ( (bit) == MSBFirst ? 1 : 0 ) << 3 ) | \
226 ( ( (byte) == MSBFirst ? 1 : 0 ) << 2 ) | \
227 ( PCF_SIZE_TO_INDEX( glyph ) << 0 ) )
228
229#define PCF_PROPERTIES ( 1 << 0 )
230#define PCF_ACCELERATORS ( 1 << 1 )
231#define PCF_METRICS ( 1 << 2 )
232#define PCF_BITMAPS ( 1 << 3 )
233#define PCF_INK_METRICS ( 1 << 4 )
234#define PCF_BDF_ENCODINGS ( 1 << 5 )
235#define PCF_SWIDTHS ( 1 << 6 )
236#define PCF_GLYPH_NAMES ( 1 << 7 )
237#define PCF_BDF_ACCELERATORS ( 1 << 8 )
238
239#define GLYPHPADOPTIONS 4 /* I'm not sure about this */
240
244 FT_Long face_index );
245
247
248#endif /* PCF_H_ */
249
250
251/* END */
#define FT_LOCAL(x)
Definition: ftconfig.h:386
#define FT_END_HEADER
Definition: ftheader.h:54
#define FT_BEGIN_HEADER
Definition: ftheader.h:36
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
unsigned long FT_ULong
Definition: fttypes.h:253
unsigned char FT_Byte
Definition: fttypes.h:154
int FT_Error
Definition: fttypes.h:299
signed long FT_Long
Definition: fttypes.h:242
unsigned short FT_UShort
Definition: fttypes.h:209
char FT_String
Definition: fttypes.h:187
signed short FT_Short
Definition: fttypes.h:198
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
pcf_load_font(FT_Stream stream, PCF_Face face, FT_Long face_index)
Definition: pcfread.c:1408
struct PCF_AccelRec_ * PCF_Accel
FT_BEGIN_HEADER struct PCF_TableRec_ PCF_TableRec
struct PCF_ParsePropertyRec_ PCF_ParsePropertyRec
struct PCF_DriverRec_ * PCF_Driver
FT_BEGIN_HEADER struct PCF_TableRec_ * PCF_Table
struct PCF_MetricRec_ * PCF_Metric
struct PCF_AccelRec_ PCF_AccelRec
struct PCF_PropertyRec_ * PCF_Property
struct PCF_TocRec_ * PCF_Toc
struct PCF_MetricRec_ PCF_MetricRec
struct PCF_PropertyRec_ PCF_PropertyRec
struct PCF_EncRec_ * PCF_Enc
struct PCF_FaceRec_ * PCF_Face
struct PCF_Compressed_MetricRec_ * PCF_Compressed_Metric
struct PCF_EncRec_ PCF_EncRec
struct PCF_ParsePropertyRec_ * PCF_ParseProperty
struct PCF_DriverRec_ PCF_DriverRec
struct PCF_TocRec_ PCF_TocRec
struct PCF_Compressed_MetricRec_ PCF_Compressed_MetricRec
struct PCF_FaceRec_ PCF_FaceRec
FT_Byte constantMetrics
Definition: pcf.h:123
FT_Byte drawDirection
Definition: pcf.h:128
FT_Long fontDescent
Definition: pcf.h:130
FT_Long fontAscent
Definition: pcf.h:129
PCF_MetricRec minbounds
Definition: pcf.h:132
FT_Byte constantWidth
Definition: pcf.h:125
PCF_MetricRec ink_minbounds
Definition: pcf.h:134
FT_Byte inkMetrics
Definition: pcf.h:127
PCF_MetricRec ink_maxbounds
Definition: pcf.h:135
FT_Byte noOverlap
Definition: pcf.h:122
PCF_MetricRec maxbounds
Definition: pcf.h:133
FT_Byte inkInside
Definition: pcf.h:126
FT_Byte terminalFont
Definition: pcf.h:124
FT_Long maxOverlap
Definition: pcf.h:131
FT_Byte characterWidth
Definition: pcf.h:87
FT_Byte leftSideBearing
Definition: pcf.h:85
FT_Byte rightSideBearing
Definition: pcf.h:86
FT_DriverRec root
Definition: pcf.h:172
FT_Bool no_long_family_names
Definition: pcf.h:174
FT_UShort * offset
Definition: pcf.h:115
FT_UShort firstCol
Definition: pcf.h:109
FT_UShort firstRow
Definition: pcf.h:111
FT_UShort lastRow
Definition: pcf.h:112
FT_UShort lastCol
Definition: pcf.h:110
FT_UShort defaultChar
Definition: pcf.h:113
char * charset_encoding
Definition: pcf.h:151
char * charset_registry
Definition: pcf.h:152
FT_FaceRec root
Definition: pcf.h:146
FT_Stream comp_source
Definition: pcf.h:149
int nprops
Definition: pcf.h:157
FT_ULong nmetrics
Definition: pcf.h:160
PCF_AccelRec accel
Definition: pcf.h:155
PCF_TocRec toc
Definition: pcf.h:154
PCF_Metric metrics
Definition: pcf.h:161
PCF_EncRec enc
Definition: pcf.h:163
FT_StreamRec comp_stream
Definition: pcf.h:148
FT_ULong bitmapsFormat
Definition: pcf.h:165
PCF_Property properties
Definition: pcf.h:158
FT_Short attributes
Definition: pcf.h:101
FT_Short characterWidth
Definition: pcf.h:98
FT_Short leftSideBearing
Definition: pcf.h:96
FT_Short ascent
Definition: pcf.h:99
FT_Short rightSideBearing
Definition: pcf.h:97
FT_Short descent
Definition: pcf.h:100
FT_ULong bits
Definition: pcf.h:102
FT_Byte isString
Definition: pcf.h:61
FT_Long name
Definition: pcf.h:60
FT_Long value
Definition: pcf.h:62
FT_String * atom
Definition: pcf.h:74
FT_Long l
Definition: pcf.h:75
union PCF_PropertyRec_::@4379 value
FT_String * name
Definition: pcf.h:69
FT_Byte isString
Definition: pcf.h:70
FT_ULong ul
Definition: pcf.h:76
FT_ULong format
Definition: pcf.h:42
FT_ULong size
Definition: pcf.h:43
FT_ULong offset
Definition: pcf.h:44
FT_ULong type
Definition: pcf.h:41
PCF_Table tables
Definition: pcf.h:53
FT_ULong version
Definition: pcf.h:51
FT_ULong count
Definition: pcf.h:52
Definition: parse.h:23