def text.expand.node
gralha-svg-render@0.1.0.1 · svg.bend:3625
import gralha-svg-render@0.1.0.1/svg.bend as Svg
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
3625def text.expand.node(+n: String, +as: List<&2, XML.Attr>, +kids: List<&2, XML.Element>, txt: String, +font: TextFont, +vp: Viewport,
3626 expand: List<&2, XML.Element> -> TextFont -> F32 -> F32 -> List<&2, XML.Element>) -> XML.Element:
3627 Viewport{matrix, w, h, clip, valid} = vp
3628 +f = U.choose(TextFont, U.string.equal(n, "#svg-image"), text.font.reset(font), text.font.inherit(font, as))
3629 U.branch(XML.Element, U.string.equal(n, "text"),
3630 _ => text.finish(text.length(text.layout(kids, f, Con{text.frame(as, 0, w, h, text.font.em(f)), Nil{}}, text.cursor(), w, h, False{}), as, w, text.font.em(f), True{}), as),
3631 _ => XML.Element{n, as, expand(kids)(f)(w)(h), txt})
3632
3633@unsafe