-
Notifications
You must be signed in to change notification settings - Fork 0
/
glyph-doc.lisp
96 lines (88 loc) · 3.41 KB
/
glyph-doc.lisp
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
(in-package :glyph)
(defun document (package doc-strings)
(let ((package (find-package package)))
(dolist (doc-string doc-strings)
(destructuring-bind (fn . doc) doc-string
(setf (documentation (find-symbol (symbol-name fn) package) 'function) doc)))))
(document :glyph
'(;;Identifiers
(index
.
"The index used to look up the glyph in the font tables.")
(name
.
"Returns the postscript name, if any, of the glyph.")
(font
.
"The font the glyph belongs to.")
;;glyph measurements
(em
.
"The size of the grid within which, at least historically, the glyph resides. Used to scale fonts for display.")
(bounding-box
.
"Returns a vector of x-min y-min x-max y-max bounding the glyph.")
(x-min
.
"Distance from origin to left side of bounding box.") ;only horizontal origin?
(x-max
.
"Distance from origin to right side of bounding box.")
(y-min
.
"Distance from origin to bottom of bounding box.")
(y-max
.
"Distance from origin to top of bounding box.")
(width
.
"Horizontal extent of a glyph. (- x-max m-min)")
(height
.
"Vertical extent of a glyph.(- y-max y-min")
(size
.
"(width . height)")
;;environment measurements
(left-side-bearing
.
"The horizontal distance from the horizontal origin to the glyph's left bounding box edge. Mostly positive values for horizontal scripts. Also known as bearingY in some systems.")
(right-side-bearing
.
"In horizontal scripts describes the
distance from the bounding box's right edge to the advance width.")
(top-side-bearing
.
"The vertical distance from the vertical origin to the top of the glyph's bbox. It is usually positive for horizontal layouts, and negative for vertical ones. AKA bearingY.")
(bottom-side-bearing
.
"The vertical distance from the bottom of a glyph's bounding box to the advance height.")
(advance-width
.
"Distance to advance horizontally after rendering this glyph. Does not take into account kerning nor tracking.
In FreeType and other systems this is called advanceX.")
(advance-height
.
"Distance to advance vertically after rendering this glyph. Does not take into account kerning nor tracking.
In FreeType and other systems this is also called advanceY.")
(origin
.
"Returns (cons dx dy) from the top left corner to glyph origin.");say this isn't so blitting centric.
(kerning
.
"Returns the kerning distance from glyph1 to glyph2.")
(kerning-pairs
.
"Returns a list of all kerning pairs for the given glyph.")
(data
.
"Returns the raw data for a glyph as parsed by the specific font reader.")
(paths
.
"Returns the glyph data as a cl-vectors path.")
(raster
.
"Returns three values, the glyph in raster format, optionally at given pixels per em, a cons of width height and a cons of offset x y.")
(anchors
.
"Returns all the anchor points for a glyph.")))