def ttf.glyph.at
gralha-truetype@0.1.0.1 · font.bend:398
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
import gralha-bytes@0.1.0.1/bytes.bend as Bin
398def ttf.glyph.at(+b: Bin.Bytes, +f: TTFont, loc: U32 & U32) -> TTGlyph:
399 (g, len) = loc
400 +gg = g
401 +contours = ttf.u16(b, gg)
402 U.branch(TTGlyph, U32.is_eq(len, 0), _ => ttf.glyph.empty(),
403 _ => U.branch(TTGlyph, U32.is_ge(contours, 32768),
404 _ => ttf.assemble(b, f, 256n, Con{TTFrame{(gg + 10 : U32), ttf.glyph.empty(), ttf.place.identity()}, Nil{}}),
405 _ => ttf.simple(b, gg, contours)))