File: ALLEGRO_GLYPH.3

package info (click to toggle)
allegro5 2%3A5.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 23,032 kB
  • sloc: ansic: 120,340; cpp: 15,707; objc: 4,805; python: 2,915; java: 2,195; sh: 887; xml: 86; makefile: 49; perl: 37; pascal: 24
file content (54 lines) | stat: -rw-r--r-- 1,829 bytes parent folder | download
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
.TH "ALLEGRO_GLYPH" "3" "" "Allegro reference manual" ""
.SH NAME
.PP
ALLEGRO_GLYPH \- Allegro 5 API
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\ <allegro5/allegro_font.h>

typedef\ struct\ ALLEGRO_GLYPH\ ALLEGRO_GLYPH;
\f[]
.fi
.SH DESCRIPTION
.PP
A structure containing the properties of a character in a font.
.IP
.nf
\f[C]
typedef\ struct\ ALLEGRO_GLYPH\ {
\ \ \ ALLEGRO_BITMAP\ *bitmap;\ \ \ //\ the\ bitmap\ the\ character\ is\ on
\ \ \ int\ x;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ the\ x\ position\ of\ the\ glyph\ on\ bitmap
\ \ \ int\ y;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ the\ y\ position\ of\ the\ glyph\ on\ bitmap
\ \ \ int\ w;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ the\ width\ of\ the\ glyph\ in\ pixels
\ \ \ int\ h;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ the\ height\ of\ the\ glyph\ in\ pixels
\ \ \ int\ kerning;\ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ pixels\ of\ kerning\ (see\ below)
\ \ \ int\ offset_x;\ \ \ \ \ \ \ \ \ \ \ \ \ //\ x\ offset\ to\ draw\ the\ glyph\ at
\ \ \ int\ offset_y;\ \ \ \ \ \ \ \ \ \ \ \ \ //\ y\ offset\ to\ draw\ the\ glyph\ at
\ \ \ int\ advance;\ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ number\ of\ pixels\ to\ advance\ after\ this\ character
}\ ALLEGRO_GLYPH;
\f[]
.fi
.PP
bitmap may be a sub\-bitmap in the case of color fonts.
.PP
kerning should be added to the x position you draw to if you want your
text kerned and depends on which codepoints al_get_glyph(3) was called
with.
.PP
Glyphs are tightly packed onto the bitmap, so you need to add offset_x
and offset_y to your draw position for the text to look right.
.PP
advance is the number of pixels to add to your x position to advance to
the next character in a string and includes kerning.
.SH SINCE
.PP
5.2.1
.RS
.PP
\f[I][Unstable API]:\f[] This API is new and subject to refinement.
.RE
.SH SEE ALSO
.PP
al_get_glyph(3)