pub trait TextLayout {
// Required methods
fn typeface(&self) -> FontChoice;
fn layout(&self, text: &str, font: &Font, wrap: WorldPx) -> Layout;
}Expand description
A host’s text engine, as the exporters need to read it.
Required Methods§
Sourcefn typeface(&self) -> FontChoice
fn typeface(&self) -> FontChoice
The typeface this engine lays text out in. The SVG export traces its outlines from that face’s own bytes, so an engine that answered for a different one would place one font’s glyphs at another’s pen positions.
Sourcefn layout(&self, text: &str, font: &Font, wrap: WorldPx) -> Layout
fn layout(&self, text: &str, font: &Font, wrap: WorldPx) -> Layout
Lay text out in font, word-wrapped at wrap
(WorldPx::UNBOUNDED for an unwrapped run). An exporter’s engine
lays out at one pixel per point, so a resolution-independent format
inherits no display’s DPI; the screen’s lays out at the display’s, so
a mark recorded through it lands where the screen draws it.