def ttf.coverage.walk
gralha-truetype@0.1.0.1 · font.bend:604
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
604def ttf.coverage.walk(+b: Bin.Bytes, n: Nat, +at: U32, +index: U32) -> U32:
605 match n:
606 case 0n: 0
607 case 1n+d:
608 +start = ttf.u16(b, at)
609 +end = ttf.u16(b, (at + 2 : U32))
610 +first = ttf.u16(b, (at + 4 : U32))
611 U.branch(U32, U32.is_ge(index, first) && U32.is_le((index - first : U32), (end - start : U32)), _ => (start + index - first : U32), _ => ttf.coverage.walk(b, d, (at + 6 : U32), index))