Font.ttf.cmap.pick: def of gralha-truetype@0.1.0.1 Import: import gralha-truetype@0.1.0.1/font.bend as Font Lines 658-666 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=658&end_line=666 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.cmap.pick(+b: Bin.Bytes, n: Nat, +cmap: U32, +at: U32, +best: U32, +score: U32) -> U32: match n: case 0n: best case 1n+d: +dd = d +s = ttf.cmap.score(ttf.u16(b, at), ttf.u16(b, (at + 2 : U32))) U.branch(U32, U32.is_gt(s, score), _ => ttf.cmap.pick(b, dd, cmap, (at + 8 : U32), (cmap + ttf.u32(b, (at + 4 : U32)) : U32), s), _ => ttf.cmap.pick(b, dd, cmap, (at + 8 : U32), best, score)) Uses (9): 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.is_gt 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.cmap.score https://jend.leeeet.dev/definition.txt?path=gralha-truetype@0.1.0.1/font.bend&name=ttf.u16 https://jend.leeeet.dev/definition.txt?path=gralha-truetype@0.1.0.1/font.bend&name=ttf.u32