Font.ttf.coords: def of gralha-truetype@0.1.0.1 Import: import gralha-truetype@0.1.0.1/font.bend as Font Lines 199-209 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=199&end_line=209 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 # One coordinate axis: short bytes with a sign flag, repeated values, or signed word deltas. def ttf.coords(+b: Bin.Bytes, flags: List<&2, U32>, +at: U32, +prev: F32, +short: U32, +same: U32) -> List<&2, F32> & U32: match flags: case Nil{}: (Nil{}, at) case Con{f, rest}: +fl = f +isShort = ttf.bit(fl, short) +isSame = ttf.bit(fl, same) +v = U.branch(F32, isShort, _ => (prev + U.choose(F32, isSame, 1.0, F32.neg(1.0)) * U32.to_f32(ttf.u8(b, at)) : F32), _ => U.branch(F32, isSame, _ => prev, _ => (prev + ttf.i16(b, at) : F32))) ttf.after.coord(v, ttf.coords(b, rest, (at + U.choose(U32, isShort, 1, U.choose(U32, isSame, 0, 2)) : U32), v, short, same)) Uses (17): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.neg https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma 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.to_f32 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-text-scan@0.1.0.1/scan.bend&name=choose https://jend.leeeet.dev/definition.txt?path=gralha-truetype@0.1.0.1/font.bend&name=ttf.after.coord https://jend.leeeet.dev/definition.txt?path=gralha-truetype@0.1.0.1/font.bend&name=ttf.bit https://jend.leeeet.dev/definition.txt?path=gralha-truetype@0.1.0.1/font.bend&name=ttf.i16 https://jend.leeeet.dev/definition.txt?path=gralha-truetype@0.1.0.1/font.bend&name=ttf.u8