def font.parse.glyph
gralha-truetype@0.1.0.1 · font.bend:53
import gralha-truetype@0.1.0.1/font.bend as Font
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U
53def font.parse.glyph(key: String, scan: U.Scan, book: FontBook) -> FontBook:
54 U.Scan{metrics, outline} = scan
55 FontBook{glyphs, kerning, faceMetrics, faces} = book
56 +vs = U.numbers(metrics)
57 FontBook{Map.set(&2, FontGlyph, glyphs, key, FontGlyph{U.nth(vs, 0n, 600.0), outline,
58 F32.to_u32(U.nth(vs, 1n, 0.0)), F32.to_u32(U.nth(vs, 2n, 0.0)), F32.to_u32(U.nth(vs, 3n, 0.0))}), kerning, faceMetrics, faces}