aboutsummaryrefslogtreecommitdiffstats
path: root/LIBAXL_REQUEST_OPEN_FONT.3
blob: f8dbf3a8762c237e7e09bd9748125109132cf7e8 (plain) (blame)
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
.TH LIBAXL_REQUEST_OPEN_FONT 3 libaxl
.SH NAME
LIBAXL_REQUEST_OPEN_FONT - Load a font
.SH SYNOPSIS
.nf
#include <libaxl.h>

#define LIBAXL_REQUEST_OPEN_FONT 45
struct libaxl_request_open_font {
        uint8_t       \fIopcode\fP;
        uint8_t       \fI__pad1\fP;
        uint16_t      \fI_request_length\fP;
        libaxl_font_t \fIfid\fP;
        uint16_t      \fIlength_of_name\fP;
        uint16_t      \fI__pad2\fP;
        char         *\fIname\fP;
};
.fi
.SH DESCRIPTION
The display server shall load a font matching
the font name pattern specified in the
.I name
field, which shall be encoded in ISO Latin-1 and
is case insensitive, whose length is specified
in the
.I length_of_name
field. The loaded font shall be given the
ID specified in the
.I fid
field, which shall be an unused ID generated
with the
.BR libaxl_generate_id (3)
function.
.PP
The value of the
.I opcode
field shall be
.I LIBAXL_REQUEST_OPEN_FONT
to signify that the request is of the
request described in this document.
.PP
Other fields are filled in automatically by the
.BR libaxl_send_request (3)
function.
.PP
If the
.B ?\,
character is used in the font name pattern,
it will matching any single character, the
.B *
character will match any number of characters. A
structured format for font names is specified in the
X.Org standard X Logical Font Description Conventions.
.SH ERRORS
.TP
.BR LIBAXL_ERROR_ALLOC (3)
The display server failed to allocate
enough memory to fulfil the request.
.TP
.BR LIBAXL_ERROR_ID_CHOICE (3)
The specified ID for the font
.RI ( fid )
is outside the range of IDs allocated to
the client or is already in use. Use the
.BR libaxl_generate_id (3)
function to avoid this error.
.TP
.BR LIBAXL_ERROR_NAME (3)
The font name in the request
.RI ( name )
is invalid: the font does not exist.
.SH REPLIES
None.
.SH EXTENDED DESCRIPTION
.SS Font names according to the X Logical Font Description Conventions
Font names are case insensitive, must not e longer than 255 characters,
and consists only of ISO 8859-1 graphic characters but not
.B ?\,
(question mark),
.B *\,
(asterisk),
.B ,\,
(comma), or
.B \(dq\,
(quotation mark).
.PP
Private fonts shall not conform fully to the following
specification. Fonts from X-registered foundaries shall
have a name with the following format:
.nf
	\fB\(dq-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s\(dq,\fP
		<\fIFoundary\fP>\fB,\fP
		<\fIFamily name\fP>\fB,\fP
		<\fIWeight name\fP>\fB,\fP
		<\fISlant\fP>\fB,\fP
		<\fISet-width name\fP>\fB,\fP
		<\fIAdditional style name\fP>\fB,\fP
		<\fIPixel size\fP>\fB,\fP
		<\fIPoint size\fP>\fB,\fP
		<\fIX-resolution\fP>\fB,\fP
		<\fIY-resolution\fP>\fB,\fP
		<\fISpacing\fP>\fB,\fP
		<\fIAverage width\fP>\fB,\fP
		<\fICharacter-set registry\fP>\fB,\fP
		<\fICharacter-set encoding\fP>
.fi
optionally prefixed with a
.B +\,
(plus) followed by a X Logical Font Description version number that
defines an extension to the font name syntax. The values of the fields
may not contain the
.B -\,
(hyphen) character.
.PP
The fields in font names are:
.TP
.I Foundary
The font's foundary. More information can be
found in the X Logical Font Description specification.
.TP
.I Family name
The typeface family name, this is what the typical
user knows as the font name.
.TP
.I Weight name
The font's typographic weight (nomincal blackness),
for example
.BR Medium ,
.BR Bold ,
or
.BR DemiBold .
.TP
.I Slant
Either
.B R
for roman,
.B I
for italic,
.B O
for oblique,
.B RI
for reverse italic,
.B RO
for reverse oblique,
.B OT
for other, or a numberic value
for polymorphic fonts.
.TP
.I Set-width name
The font's typographic proportionate width,
for example
.BR Normal ,
.BR Condensed ,
.BR Narrow ,
or
.BR "Double Wide" ,
or
.B 0
if the font is polymorphic.
.TP
.I Additional style name
A string that identifies additional typographic
style information, for example
.BR Serif ,
.BR "Sans Serif" ,
.BR Informal ,
or
.BR Decorated .
The
.B [
character anywhere in the field is used to
indicate a polymorphic font.
.TP
.I Pixel size
The height of the font, in whole pixels.
This is not necessarily equivalent to the
height of the font bounding box.
.B 0
if the font is scalable. Alternatively the
field may be a transformation matrix.
.TP
.I Point size
The height of the font, in whole decipixels.
This is not necessarily equivalent to the
height of the font bounding box.
.B 0
if the font is scalable. Alternatively the
field may be a transformation matrix.

722.7\ decipoints (72.27\ points) is equal
to 1\ inch or 2.54\ cm.
.TP
.I X-resolution
Unsigned integer that give the horizontal
resolution, measured in dots (or pixels) per
inch, for which the font was designed.
.B 0
if the font is scalable font.
.TP
.I Y-resolution
Unsigned integer that give the vertical
resolution, measured in dots (or pixels) per
inch, for which the font was designed.
.B 0
if the font is scalable font.
.TP
.I Spacing
The escapement class of the font:
.B P
for proportional (variable pitch),
.B M
for monospace (fixed pitch), or
.B C
for charcell (a special monospaced font that
conforms to the traditional data-processing
character cell font model).
.TP
.I Average width
The unweighted arithmetic mean of the absolute
value of the width of each glyph in the font,
measured in decipixels. Prefixed with a
.B ~
(tilde) if the dominant writing direction for
the font is right-to-left.
.B 0
if the font is scalable (without potential
.BR ~ -prefix).
.TP
.IR "Character-set registry" ", " "Character-set encoding"
The registration character-set. More information
can be found in the X Logical Font Description
specification.

.I Character-set encoding
can be suffixed with a subset hint. More information
can be found in the X Logical Font Description
specification.
.PP
As an example of a font name pattern,
.B "-misc-fixed-medium-r-normal-*-12-*-*-*-c-*-iso10646-1"
is widely installed and is a good font for terminals. Its
foundary is
.BR misc ,
its family name is
.BR fixed ,
it is
.B medium
(weight name),
.B roman
(slant),
.B normal
(set-width name),
.B 12
pixels high (pixel size),
monospaced with standard typewriter character cell model
.RB ( c )
(spacing),
and uses the Universal Character Set
.B (iso10646-1)
(character-set registry and character-set encoding).
.SH SEE ALSO
.BR libaxl_send_request (3),
.BR LIBAXL_REQUEST_CLOSE_FONT (3),
.BR LIBAXL_REQUEST_QUERY_FONT (3),
.BR LIBAXL_REQUEST_QUERY_TEXT_EXTENTS (3),
.BR LIBAXL_REQUEST_LIST_FONTS (3),
.BR LIBAXL_REQUEST_LIST_FONTS_WITH_INFO (3),
.BR LIBAXL_REQUEST_SET_FONT_PATH (3),
.BR LIBAXL_REQUEST_GET_FONT_PATH (3)