-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhead_src.go
33 lines (31 loc) · 943 Bytes
/
head_src.go
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
package tables
// TableHead contains critical information about the rest of the font.
// https://learn.microsoft.com/en-us/typography/opentype/spec/head
// https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6head.html
type Head struct {
majorVersion uint16
minorVersion uint16
fontRevision uint32
checksumAdjustment uint32
magicNumber uint32
flags uint16
UnitsPerEm uint16
created longdatetime
modified longdatetime
XMin int16
YMin int16
XMax int16
YMax int16
macStyle uint16
lowestRecPPEM uint16
fontDirectionHint int16
IndexToLocFormat int16
glyphDataFormat int16
}
// Upem returns a sanitize version of the 'UnitsPerEm' field.
func (head *Head) Upem() uint16 {
if head.UnitsPerEm < 16 || head.UnitsPerEm > 16384 {
return 1000
}
return head.UnitsPerEm
}