plot::font
The built-in font: Geist Regular, with Greek and some mathematical symbols from Pretendard, as outlines in font units (glyphs.nabi, generated by tools/font.py). The SVG backend uses only the advance widths, to lay text out as a browser with Geist would; the rasterizer fills the outlines.
Functions
coversSource
pub fn covers(c: char) -> bool Whether the font has a glyph for c.
nabi
assert(plot::font::covers('a') && plot::font::covers('\u{3b1}'));
assert(!plot::font::covers('\u{4e00}'));
widthSource
pub fn width(s: str, size: f64) -> f64 The width of s set in the built-in font at size px.
nabi
let w = plot::font::width("Hello", 10.0);
assert(w > 20.0 && w < 40.0);