def ttf.classdef
gralha-truetype@0.1.0.1 · font.bend:631
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
631def ttf.classdef(+b: Bin.Bytes, +cd: U32, +gid: U32) -> U32:
632 +start = ttf.u16(b, (cd + 2 : U32))
633 +count = ttf.u16(b, (cd + 4 : U32))
634 U.branch(U32, U32.is_eq(cd, 0), _ => 0,
635 _ => U.branch(U32, U32.is_eq(ttf.u16(b, cd), 1),
636 _ => U.choose(U32, U32.is_ge(gid, start) && U32.is_lt((gid - start : U32), count), ttf.u16(b, (cd + 6 + (gid - start) * 2 : U32)), 0),
637 _ => ttf.classdef.ranges(b, 20n, (cd + 4 : U32), 0, ttf.u16(b, (cd + 2 : U32)), gid)))