Svg.text.path.glyph: def of gralha-svg-render@0.1.0.1 Import: import gralha-svg-render@0.1.0.1/svg.bend as Svg Lines 3564-3569 of gralha-svg-render@0.1.0.1/svg.bend: https://jend.leeeet.dev/read.txt?path=gralha-svg-render@0.1.0.1/svg.bend&start_line=3564&end_line=3569 import Base import gralha-text-scan@0.1.0.1/scan.bend as U import gralha-xml-doc@0.1.0.1/xml.bend as XML def text.path.glyph(+as: List<&2, XML.Attr>, +edges: List<&2, Edge>, +total: F32, offset: F32, +mat: Matrix) -> List<&2, XML.Element>: Matrix{a, b, c, d, e, f} = mat +advance = U.scalar(XML.attr.get(as, "#glyph-advance", "0"), 0.0) +mid = (e + advance * F32.sqrt((a * a + b * b : F32)) / 2.0 + offset : F32) U.branch(List<&2, XML.Element>, F32.is_lt(mid, 0.0) || F32.is_gt(mid, total) || F32.is_le(total, 0.0), _ => Nil{}, _ => Con{XML.Element{"#glyph", Con{XML.Attr{"#glyph-transform", matrix.show(text.path.glyph.matrix(mat, text.path.at(edges, mid, identity()), advance))}, as}, Nil{}, ""}, Nil{}}) Uses (21): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or 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.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.is_gt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.is_lt 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.sqrt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=Edge https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=Matrix https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=identity https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=matrix.show https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=text.path.at https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=text.path.glyph.matrix 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=scalar https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=Attr https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=Element https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attr.get