Font.ttf.classdef.ranges: def of gralha-truetype@0.1.0.1 Import: import gralha-truetype@0.1.0.1/font.bend as Font Lines 618-629 of gralha-truetype@0.1.0.1/font.bend: https://jend.leeeet.dev/read.txt?path=gralha-truetype@0.1.0.1/font.bend&start_line=618&end_line=629 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 def ttf.classdef.ranges(+b: Bin.Bytes, fuel: Nat, +base: U32, +lo: U32, +hi: U32, +gid: U32) -> U32: match fuel: case 0n: 0 case 1n+d: +dd = d +mid = U32.div((lo + hi : U32), 2) +at = (base + mid * 6 : U32) +start = ttf.u16(b, at) +end = ttf.u16(b, (at + 2 : U32)) U.branch(U32, U32.is_ge(lo, hi), _ => 0, _ => U.branch(U32, U32.is_lt(gid, start), _ => ttf.classdef.ranges(b, dd, base, lo, mid, gid), _ => U.branch(U32, U32.is_gt(gid, end), _ => ttf.classdef.ranges(b, dd, base, (mid + 1 : U32), hi, gid), _ => ttf.u16(b, (at + 4 : U32))))) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_ge https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_gt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=branch https://jend.leeeet.dev/definition.txt?path=gralha-truetype@0.1.0.1/font.bend&name=ttf.u16