1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
.TH LIBPARSEPCF_GET_PROPERTIES 3 LIBPARSEPCF
.SH NAME
libparsepcf_get_properties \- Get font properties
.SH SYNOPSIS
.nf
#include <libparsepcf.h>
#define LIBPARSEPCF_PROPERTIES /* value omitted */
struct libparsepcf_properties {
size_t \fIproperty_count\fP;
/* fields intended for internal use omitted */
};
struct libparsepcf_property_subtable {
const char *\fIname\fP;
int \fIis_string_property\fP;
union {
int32_t \fIsigned_value\fP;
const char *\fIstring_value\fP;
} \fIvalue\fP;
};
int libparsepcf_get_properties(const void *\fIdata\fP, size_t \fIsize\fP,
const struct libparsepcf_table *\fItable\fP,
struct libparsepcf_properties *\fImeta_out\fP);
int libparsepcf_get_property_subtable(const void *\fIdata\fP, size_t \fIsize\fP,
const struct libparsepcf_table *\fItable\fP,
const struct libparsepcf_properties *\fImeta\fP,
struct libparsepcf_property_subtable *\fIprops\fP,
size_t \fIfirst\fP, size_t \fIcount\fP);
.fi
.PP
Link with
.IR -lparsepcf .
.SH DESCRIPTION
A PCF font files should record font
properties in the table with the type
.B LIBPARSEPCF_PROPERTIES
which can be retrieved with the
.BR libparsepcf_get_tables (3)
function.
.PP
Once the
.B LIBPARSEPCF_PROPERTIES
table has been identified, it can be passed as
the third argument
.RI ( table )
to the
.BR libparsepcf_get_properties ()
function along with the font file contents in the
.I data
argument and size, in bytes, of the file in the
.I size
argument. The
.BR libparsepcf_get_properties ()
function will store the number of available
properties in
.IR meta_out->property_count ,
as well as internal information needed by the
.BR libparsepcf_get_property_subtable ()
function in other fields in
.IR *meta_out .
.PP
Then the
.BR libparsepcf_get_property_subtable ()
function can be used to get each font property.
The first four arguments shall be
the same as with
.BR libparsepcf_get_properties ().
.I first
shall be the index of the property with the lowest
index of the property the function shall get, and
.I count
shall be the number of consecutive properties
(including the first properties) to get. For each
queried properties with index
.IR i ,
the property name will be stored in
.I props[i]->name
and the property value will be stored in
.I props[i]->value.signed_value
it it is numerical and in
.I props[i]->value.string_value
if it is a textual. In the former case
.I props[i]->is_string_property
will be set to 0 and in the latter case
.I props[i]->is_string_property
will be set to 1.
.PP
The application shall ensure that
.IR "first + count <= meta->property_count" .
.SH RETURN VALUE
The
.BR libparsepcf_get_properties ()
and
.BR libparsepcf_get_property_subtable ()
functions return 0 upon successful completion.
On failure, -1 is returned and
.I errno
is set appropriately to indicate the error.
.SH ERRORS
The
.BR libparsepcf_get_properties ()
and
.BR libparsepcf_get_property_subtable ()
functions fail if:
.TP
.B EBFONT
The font file is corrupt or unsupported.
.SH EXTENDED DESCRIPTION
For X fonts, the file will some of the properties
listing in
.IR https://www.x.org/releases/X11R7.7/doc/xorg-docs/xlfd/xlfd.html .
Particularly important fields are:
.TP
.B FAMILY_NAME
The name of the font. Note that the name is not
necessarily unique, but must be combined with other
identification properties to unique identify the
font or font family.
.TP
.B FONT
X Logical Font Descriptor. This uniquely identifies
the the font and some of its properties.
.TP
.B SLANT
The font's slant style. Common values are
\(dqR\(dq for roman, \(dqI\(dq for italic, and
\(dqO\(dq for oblique.
.TP
.B ADD_STYLE_NAME
The font's style, apart from slant style. Common
values are \(dqSerif\(dq, \(dqSans Serif\(dq, and
\(dq\(dq.
.TP
.B SPACING
The font's width-variableness, \(dqP\(dq for
proportional, \(dqM\(dq for monospaced, and
\(dqC\(dq for character-cell (monospaced font that
follows the standard typewriter character cell model).
.TP
.B AVERAGE_WIDTH
Mostly useful for character-cell types, where it
specifies the cell width in decipixels.
.TP
.B PIXEL_SIZE
The height of the font in pixels.
.TP
.B CAP_HEIGHT
The nominal height of majuscule letters in pixels.
.TP
.B X_HEIGHT
The nominal height of minuscule letters in pixels.
.TP
.B POINT_SIZE
The height of the font in decipoints.
.TP
.B RESOLUTION_X
The horizontal resolution, in dots per inch, the
font was designed for.
.TP
.B RESOLUTION_Y
The vertical resolution, in dots per inch, the
font was designed for.
.TP
.BR CHARSET_REGISTRY " and " CHARSET_ENCODING
Identifies the character encoding used by the
font, ISO10646-1 (the combination \(dqISO10646\(dq,
\(dq1\(dq) is particularly important.
.SH SEE ALSO
.BR libparsepcf (7),
.BR libparsepcf_preparse_font (3)
|