def ttf.cmap.subtable

gralha-truetype@0.1.0.1 · font.bend:717

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

717# The best Unicode subtable (formats 4 and 12), 0 when the font has none.
718def ttf.cmap.subtable(+b: Bin.Bytes) -> U32:
719  +cmap = ttf.table(b, 1668112752)
720  U.branch(U32, U32.is_eq(cmap, 0), _ => 0, _ => ttf.cmap.pick(b, U32.to_nat(ttf.u16(b, (cmap + 2 : U32))), cmap, (cmap + 4 : U32), 0, 0))

Uses (9)

Used by (1)