def text.font.size

gralha-svg-render@0.1.0.1 · svg.bend:3185

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

3185def text.font.size(+s: String, +parent: F32) -> F32:
3186  U.choose(F32, U.string.equal(s, "smaller"), (parent / 1.2 : F32), U.choose(F32, U.string.equal(s, "larger"), (parent * 1.2 : F32),
3187    U.choose(F32, U.string.equal(s, "medium"), 16.0, U.choose(F32, U.string.equal(s, "small"), 13.0,
3188      U.choose(F32, U.string.equal(s, "large"), 18.0, U.max(0.0, text.measure(U.number(s), parent, parent)))))))

Uses (9)

Used by (1)