aboutsummaryrefslogtreecommitdiffstats
path: root/libparsepsf_get_glyph.3
blob: bb2c481d2be6695bafcd58afba9b62aba83af987 (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
.TH LIBPARSEPSF_GET_GLYPH 3 LIBPARSEPSF
.SH NAME
libparsepsf_get_glyph \- Get glyph to use in a position in a text
.SH SYNOPSIS
.nf
#include <libparsepsf.h>

size_t libparsepsf_get_glyph(struct libparsepsf_font *\fIfont\fP, const char *\fIc\fP, size_t *\fIremp\fP, const char **\fInext_cp\fP);
.fi
.PP
Link with
.IR -lparsepsf .
.SH DESCRIPTION
The
.B libparsepsf_get_glyph
function gets the next glyph to print for a line of text.
.PP
.I font
be a parsed font: created with
.BR libparsepsf_parse_font (3).
.PP
.I c
shall be the current position in the text, and either
.I remp
shall be
.I NULL
or
.I *remp
shall be the number of bytes remaining in the text.
.PP
Upon successful completion, the number of bytes
read from
.I c
will be subtracted from
.IR *remp
(unless
.I remp
is
.IR NULL ),
and, unless
.I next_cp
is
.I NULL,
.I *next_cp
will be set to
.I &c[n]
where
.I n
is the number of bytes in the byte-sequence for the
returned glyph.
.PP
If and only if
.I remp
is
.IR NULL ,
the
.B libparsepsf_get_glyph
function will assume the text ends at the first NUL byte.
.PP
.I *remp
and
.I *next_cp
are only updated if the function returns a non-zero value.
.SH RETURN VALUE
The
.B libparsepsf_get_glyph
function returned a glyph index, plus 1, upon successful
completion, or 0 if the end of the text has been reached
or if there is no glyph for the current position. On
failure the function returns 0 and sets
.I errno
appropriately to indicate the error.
.SH ERRORS
The
.B libparsepsf_get_glyph
function may fail if:
.TP
.B EILSEQ
If
.I font->map
is
.I NULL
and an illegal byte sequence was found.
.SH NOTE
A sequence of multiple characters can be rendered as a
single glyph, therefore it is important that the entire
text line has been loaded and there all characters on
the line in prior positions have been mapped.
.PP
The
.B libparsepsf_get_glyph
function does not treat <newline> especially.
.SH SEE ALSO
.BR libparsepsf_parse_font (3)