Font.ttf.simple: def of gralha-truetype@0.1.0.1 Import: import gralha-truetype@0.1.0.1/font.bend as Font Lines 229-234 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=229&end_line=234 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 # A simple glyph at absolute offset g with the given contour count. def ttf.simple(+b: Bin.Bytes, +g: U32, +contours: U32) -> TTGlyph: +ends = ttf.ends(b, U32.to_nat(contours), (g + 10 : U32)) +count = U.choose(U32, U32.is_gt(contours, 0), (ttf.last(ends, 0) + 1 : U32), 0) +instructions = ttf.u16(b, (g + 10 + contours * 2 : U32)) ttf.simple.flags(b, ends, count, ttf.flags(b, U32.to_nat(count), (g + 12 + contours * 2 + instructions : U32), 0, 0)) Uses (13): 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=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat 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=choose https://jend.leeeet.dev/definition.txt?path=gralha-truetype@0.1.0.1/font.bend&name=TTGlyph https://jend.leeeet.dev/definition.txt?path=gralha-truetype@0.1.0.1/font.bend&name=ttf.ends https://jend.leeeet.dev/definition.txt?path=gralha-truetype@0.1.0.1/font.bend&name=ttf.flags https://jend.leeeet.dev/definition.txt?path=gralha-truetype@0.1.0.1/font.bend&name=ttf.last https://jend.leeeet.dev/definition.txt?path=gralha-truetype@0.1.0.1/font.bend&name=ttf.simple.flags https://jend.leeeet.dev/definition.txt?path=gralha-truetype@0.1.0.1/font.bend&name=ttf.u16