zenilib: zenilib/jni/external/freetype2/src/pcf/pcf.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 THE 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
37 FT_BEGIN_HEADER
38
39 typedef struct PCF_TableRec_
40 {
41 FT_ULong type;
42 FT_ULong format;
43 FT_ULong size;
44 FT_ULong offset;
45
46 } PCF_TableRec, *PCF_Table;
47
48
49 typedef struct PCF_TocRec_
50 {
51 FT_ULong version;
52 FT_ULong count;
53 PCF_Table tables;
54
55 } PCF_TocRec, *PCF_Toc;
56
57
58 typedef struct PCF_ParsePropertyRec_
59 {
60 FT_Long name;
61 FT_Byte isString;
62 FT_Long value;
63
64 } PCF_ParsePropertyRec, *PCF_ParseProperty;
65
66
67 typedef struct PCF_PropertyRec_
68 {
69 FT_String* name;
70 FT_Byte isString;
71
72 union
73 {
74 FT_String* atom;
75 FT_Long l;
76 FT_ULong ul;
77
78 } value;
79
80 } PCF_PropertyRec, *PCF_Property;
81
82
83 typedef struct PCF_Compressed_MetricRec_
84 {
85 FT_Byte leftSideBearing;
86 FT_Byte rightSideBearing;
87 FT_Byte characterWidth;
88 FT_Byte ascent;
89 FT_Byte descent;
90
91 } PCF_Compressed_MetricRec, *PCF_Compressed_Metric;
92
93
94 typedef struct PCF_MetricRec_
95 {
96 FT_Short leftSideBearing;
97 FT_Short rightSideBearing;
98 FT_Short characterWidth;
99 FT_Short ascent;
100 FT_Short descent;
101 FT_Short attributes;
102 FT_ULong bits;
103
104 } PCF_MetricRec, *PCF_Metric;
105
106
107 typedef struct PCF_AccelRec_
108 {
109 FT_Byte noOverlap;
110 FT_Byte constantMetrics;
111 FT_Byte terminalFont;
112 FT_Byte constantWidth;
113 FT_Byte inkInside;
114 FT_Byte inkMetrics;
115 FT_Byte drawDirection;
116 FT_Long fontAscent;
117 FT_Long fontDescent;
118 FT_Long maxOverlap;
119 PCF_MetricRec minbounds;
120 PCF_MetricRec maxbounds;
121 PCF_MetricRec ink_minbounds;
122 PCF_MetricRec ink_maxbounds;
123
124 } PCF_AccelRec, *PCF_Accel;
125
126
127 typedef struct PCF_EncodingRec_
128 {
129 FT_Long enc;
130 FT_UShort glyph;
131
132 } PCF_EncodingRec, *PCF_Encoding;
133
134
135 typedef struct PCF_FaceRec_
136 {
137 FT_FaceRec root;
138
139 FT_StreamRec comp_stream;
140 FT_Stream comp_source;
141
142 char* charset_encoding;
143 char* charset_registry;
144
145 PCF_TocRec toc;
146 PCF_AccelRec accel;
147
148 int nprops;
149 PCF_Property properties;
150
151 FT_Long nmetrics;
152 PCF_Metric metrics;
153 FT_Long nencodings;
154 PCF_Encoding encodings;
155
156 FT_Short defaultChar;
157
158 FT_ULong bitmapsFormat;
159
160 FT_CharMap charmap_handle;
161 FT_CharMapRec charmap; /* a single charmap per face */
162
163 } PCF_FaceRec, *PCF_Face;
164
165
166 /* macros for pcf font format */
167
168 #define LSBFirst 0
169 #define MSBFirst 1
170
171 #define PCF_FILE_VERSION ( ( 'p' << 24 ) | \
172 ( 'c' << 16 ) | \
173 ( 'f' << 8 ) | 1 )
174 #define PCF_FORMAT_MASK 0xFFFFFF00UL
175
176 #define PCF_DEFAULT_FORMAT 0x00000000UL
177 #define PCF_INKBOUNDS 0x00000200UL
178 #define PCF_ACCEL_W_INKBOUNDS 0x00000100UL
179 #define PCF_COMPRESSED_METRICS 0x00000100UL
180
181 #define PCF_FORMAT_MATCH( a, b ) \
182 ( ( (a) & PCF_FORMAT_MASK ) == ( (b) & PCF_FORMAT_MASK ) )
183
184 #define PCF_GLYPH_PAD_MASK ( 3 << 0 )
185 #define PCF_BYTE_MASK ( 1 << 2 )
186 #define PCF_BIT_MASK ( 1 << 3 )
187 #define PCF_SCAN_UNIT_MASK ( 3 << 4 )
188
189 #define PCF_BYTE_ORDER( f ) \
190 ( ( (f) & PCF_BYTE_MASK ) ? MSBFirst : LSBFirst )
191 #define PCF_BIT_ORDER( f ) \
192 ( ( (f) & PCF_BIT_MASK ) ? MSBFirst : LSBFirst )
193 #define PCF_GLYPH_PAD_INDEX( f ) \
194 ( (f) & PCF_GLYPH_PAD_MASK )
195 #define PCF_GLYPH_PAD( f ) \
196 ( 1 << PCF_GLYPH_PAD_INDEX( f ) )
197 #define PCF_SCAN_UNIT_INDEX( f ) \
198 ( ( (f) & PCF_SCAN_UNIT_MASK ) >> 4 )
199 #define PCF_SCAN_UNIT( f ) \
200 ( 1 << PCF_SCAN_UNIT_INDEX( f ) )
201 #define PCF_FORMAT_BITS( f ) \
202 ( (f) & ( PCF_GLYPH_PAD_MASK | \
203 PCF_BYTE_MASK | \
204 PCF_BIT_MASK | \
205 PCF_SCAN_UNIT_MASK ) )
206
207 #define PCF_SIZE_TO_INDEX( s ) ( (s) == 4 ? 2 : (s) == 2 ? 1 : 0 )
208 #define PCF_INDEX_TO_SIZE( b ) ( 1 << b )
209
210 #define PCF_FORMAT( bit, byte, glyph, scan ) \
211 ( ( PCF_SIZE_TO_INDEX( scan ) << 4 ) | \
212 ( ( (bit) == MSBFirst ? 1 : 0 ) << 3 ) | \
213 ( ( (byte) == MSBFirst ? 1 : 0 ) << 2 ) | \
214 ( PCF_SIZE_TO_INDEX( glyph ) << 0 ) )
215
216 #define PCF_PROPERTIES ( 1 << 0 )
217 #define PCF_ACCELERATORS ( 1 << 1 )
218 #define PCF_METRICS ( 1 << 2 )
219 #define PCF_BITMAPS ( 1 << 3 )
220 #define PCF_INK_METRICS ( 1 << 4 )
221 #define PCF_BDF_ENCODINGS ( 1 << 5 )
222 #define PCF_SWIDTHS ( 1 << 6 )
223 #define PCF_GLYPH_NAMES ( 1 << 7 )
224 #define PCF_BDF_ACCELERATORS ( 1 << 8 )
225
226 #define GLYPHPADOPTIONS 4 /* I'm not sure about this */
227
228 FT_LOCAL( FT_Error )
229 pcf_load_font( FT_Stream,
230 PCF_Face );
231
232 FT_END_HEADER
233
234 #endif /* __PCF_H__ */
235
236
237 /* END */
PCF_AccelRec_::constantWidth
FT_Byte constantWidth
Definition: pcf.h:112
PCF_FaceRec_::root
FT_FaceRec root
Definition: pcf.h:137
PCF_Property
struct PCF_PropertyRec_ * PCF_Property
PCF_PropertyRec
struct PCF_PropertyRec_ PCF_PropertyRec
FT_Error
int FT_Error
Definition: fttypes.h:296
PCF_TableRec_
Definition: pcf.h:39
PCF_MetricRec_::rightSideBearing
FT_Short rightSideBearing
Definition: pcf.h:97
FT_Long
signed long FT_Long
Definition: fttypes.h:238
PCF_AccelRec_::inkMetrics
FT_Byte inkMetrics
Definition: pcf.h:114
PCF_Encoding
struct PCF_EncodingRec_ * PCF_Encoding
PCF_FaceRec_::comp_source
FT_Stream comp_source
Definition: pcf.h:140
FT_ULong
unsigned long FT_ULong
Definition: fttypes.h:249
PCF_Face
struct PCF_FaceRec_ * PCF_Face
FT_END_HEADER
#define FT_END_HEADER
Definition: ftheader.h:54
PCF_Accel
struct PCF_AccelRec_ * PCF_Accel
PCF_FaceRec_::charset_registry
char * charset_registry
Definition: pcf.h:143
PCF_FaceRec_::nmetrics
FT_Long nmetrics
Definition: pcf.h:151
PCF_EncodingRec_
Definition: pcf.h:127
PCF_Compressed_Metric
struct PCF_Compressed_MetricRec_ * PCF_Compressed_Metric
PCF_MetricRec
struct PCF_MetricRec_ PCF_MetricRec
PCF_AccelRec_::terminalFont
FT_Byte terminalFont
Definition: pcf.h:111
PCF_FaceRec
struct PCF_FaceRec_ PCF_FaceRec
PCF_Table
FT_BEGIN_HEADER struct PCF_TableRec_ * PCF_Table
PCF_MetricRec_::attributes
FT_Short attributes
Definition: pcf.h:101
PCF_TableRec
FT_BEGIN_HEADER struct PCF_TableRec_ PCF_TableRec
PCF_EncodingRec
struct PCF_EncodingRec_ PCF_EncodingRec
PCF_Metric
struct PCF_MetricRec_ * PCF_Metric
PCF_TocRec
struct PCF_TocRec_ PCF_TocRec
PCF_PropertyRec_::ul
FT_ULong ul
Definition: pcf.h:76
PCF_PropertyRec_::name
FT_String * name
Definition: pcf.h:69
PCF_AccelRec_::ink_maxbounds
PCF_MetricRec ink_maxbounds
Definition: pcf.h:122
PCF_AccelRec_::maxOverlap
FT_Long maxOverlap
Definition: pcf.h:118
PCF_ParseProperty
struct PCF_ParsePropertyRec_ * PCF_ParseProperty
PCF_PropertyRec_::atom
FT_String * atom
Definition: pcf.h:74
PCF_TableRec_::format
FT_ULong format
Definition: pcf.h:42
FT_Byte
unsigned char FT_Byte
Definition: fttypes.h:150
PCF_AccelRec_
Definition: pcf.h:107
FT_BEGIN_HEADER
#define FT_BEGIN_HEADER
Definition: ftheader.h:36
PCF_FaceRec_::nprops
int nprops
Definition: pcf.h:148
PCF_PropertyRec_::value
union PCF_PropertyRec_::@37 value
PCF_AccelRec_::fontDescent
FT_Long fontDescent
Definition: pcf.h:117
FT_LOCAL
#define FT_LOCAL(x)
Definition: ftconfig.h:466
PCF_TableRec_::size
FT_ULong size
Definition: pcf.h:43
PCF_Compressed_MetricRec_::leftSideBearing
FT_Byte leftSideBearing
Definition: pcf.h:85
PCF_FaceRec_::encodings
PCF_Encoding encodings
Definition: pcf.h:154
FT_FaceRec_
Definition: freetype.h:912
PCF_AccelRec_::fontAscent
FT_Long fontAscent
Definition: pcf.h:116
PCF_FaceRec_::charmap_handle
FT_CharMap charmap_handle
Definition: pcf.h:160
PCF_FaceRec_::charset_encoding
char * charset_encoding
Definition: pcf.h:142
PCF_EncodingRec_::enc
FT_Long enc
Definition: pcf.h:129
PCF_EncodingRec_::glyph
FT_UShort glyph
Definition: pcf.h:130
FT_String
char FT_String
Definition: fttypes.h:183
PCF_FaceRec_::comp_stream
FT_StreamRec comp_stream
Definition: pcf.h:139
PCF_ParsePropertyRec_
Definition: pcf.h:58
PCF_AccelRec_::ink_minbounds
PCF_MetricRec ink_minbounds
Definition: pcf.h:121
PCF_Compressed_MetricRec_::descent
FT_Byte descent
Definition: pcf.h:89
PCF_PropertyRec_::isString
FT_Byte isString
Definition: pcf.h:70
PCF_PropertyRec_
Definition: pcf.h:67
PCF_Compressed_MetricRec_
Definition: pcf.h:83
PCF_AccelRec_::inkInside
FT_Byte inkInside
Definition: pcf.h:113
PCF_TableRec_::type
FT_ULong type
Definition: pcf.h:41
PCF_MetricRec_::characterWidth
FT_Short characterWidth
Definition: pcf.h:98
PCF_MetricRec_::descent
FT_Short descent
Definition: pcf.h:100
PCF_FaceRec_::nencodings
FT_Long nencodings
Definition: pcf.h:153
PCF_Compressed_MetricRec
struct PCF_Compressed_MetricRec_ PCF_Compressed_MetricRec
PCF_AccelRec_::noOverlap
FT_Byte noOverlap
Definition: pcf.h:109
FT_Short
signed short FT_Short
Definition: fttypes.h:194
PCF_MetricRec_::leftSideBearing
FT_Short leftSideBearing
Definition: pcf.h:96
PCF_MetricRec_::ascent
FT_Short ascent
Definition: pcf.h:99
PCF_FaceRec_::defaultChar
FT_Short defaultChar
Definition: pcf.h:156
PCF_FaceRec_::accel
PCF_AccelRec accel
Definition: pcf.h:146
ft2build.h
FT_CharMapRec_
Definition: freetype.h:736
PCF_AccelRec_::minbounds
PCF_MetricRec minbounds
Definition: pcf.h:119
PCF_AccelRec_::drawDirection
FT_Byte drawDirection
Definition: pcf.h:115
PCF_ParsePropertyRec_::name
FT_Long name
Definition: pcf.h:60
pcf_load_font
pcf_load_font(FT_Stream, PCF_Face)
Definition: pcfread.c:1105
PCF_Toc
struct PCF_TocRec_ * PCF_Toc
PCF_FaceRec_::toc
PCF_TocRec toc
Definition: pcf.h:145
PCF_Compressed_MetricRec_::rightSideBearing
FT_Byte rightSideBearing
Definition: pcf.h:86
PCF_TableRec_::offset
FT_ULong offset
Definition: pcf.h:44
PCF_FaceRec_::properties
PCF_Property properties
Definition: pcf.h:149
PCF_ParsePropertyRec_::isString
FT_Byte isString
Definition: pcf.h:61
PCF_MetricRec_::bits
FT_ULong bits
Definition: pcf.h:102
PCF_ParsePropertyRec
struct PCF_ParsePropertyRec_ PCF_ParsePropertyRec
PCF_FaceRec_::charmap
FT_CharMapRec charmap
Definition: pcf.h:161
PCF_Compressed_MetricRec_::characterWidth
FT_Byte characterWidth
Definition: pcf.h:87
PCF_Compressed_MetricRec_::ascent
FT_Byte ascent
Definition: pcf.h:88
PCF_FaceRec_::bitmapsFormat
FT_ULong bitmapsFormat
Definition: pcf.h:158
PCF_AccelRec
struct PCF_AccelRec_ PCF_AccelRec
FT_UShort
unsigned short FT_UShort
Definition: fttypes.h:205
FT_StreamRec_
Definition: ftsystem.h:321
PCF_MetricRec_
Definition: pcf.h:94
PCF_AccelRec_::maxbounds
PCF_MetricRec maxbounds
Definition: pcf.h:120
PCF_AccelRec_::constantMetrics
FT_Byte constantMetrics
Definition: pcf.h:110
PCF_FaceRec_
Definition: pcf.h:135
PCF_PropertyRec_::l
FT_Long l
Definition: pcf.h:75
PCF_ParsePropertyRec_::value
FT_Long value
Definition: pcf.h:62
PCF_FaceRec_::metrics
PCF_Metric metrics
Definition: pcf.h:152