-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathglyphs.proto
70 lines (56 loc) · 1.51 KB
/
glyphs.proto
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
// Protocol Version 1
package mapbox.fontnik;
option optimize_for = LITE_RUNTIME;
message Glyph {
// FreeType glyph index
required uint32 glyph_index = 1;
// Unicode codepoint
optional uint32 codepoint = 2;
// Glyph metrics
optional GlyphMetrics metrics = 3;
// Signed distance field bitmap rendered from glyph outlines.
optional bytes bitmap = 4;
}
message GlyphMetrics {
required sint32 width = 1;
required sint32 height = 2;
required sint32 advance = 3;
required sint32 x_bearing = 4;
required sint32 y_bearing = 5;
}
message Face {
optional string family_name = 1;
optional string style_name = 2;
repeated Glyph glyphs = 3;
optional FaceMetrics metrics = 4;
optional FaceTables tables = 5;
}
message FaceMetrics {
optional uint32 face_index = 1;
optional uint32 upem = 2;
optional sint32 ascender = 3;
optional sint32 descender = 4;
optional sint32 line_height = 5;
optional sint32 line_gap = 6;
}
message FaceTables {
optional bytes GDEF = 1;
optional bytes GSUB = 2;
optional bytes GPOS = 3;
optional bytes cmap = 4;
}
message Font {
repeated Face faces = 1;
optional Metadata metadata = 2;
extensions 16 to 8191;
}
// Signed distance field encoding metadata
message Metadata {
optional uint32 size = 1;
optional float scale = 2;
optional uint32 buffer = 3;
optional uint32 radius = 4;
optional float offset = 5;
optional float cutoff = 6;
optional uint32 granularity = 7;
}