pub struct ContextLayout {
ctx: Context,
typeface: FontChoice,
}Expand description
The fonts a context has installed, behind [TextLayout] — the very engine
the screen draws with, at the display’s resolution, so a run recorded
through it is the size the replay draws it. Not an export’s engine: what
this measures inherits the display’s DPI, which is the point of it.
Fields§
§ctx: Context§typeface: FontChoiceImplementations§
Source§impl ContextLayout
impl ContextLayout
Trait Implementations§
Source§impl TextLayout for ContextLayout
impl TextLayout for ContextLayout
Source§fn 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.
Source§fn 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.Auto Trait Implementations§
impl Freeze for ContextLayout
impl !RefUnwindSafe for ContextLayout
impl Send for ContextLayout
impl Sync for ContextLayout
impl Unpin for ContextLayout
impl UnsafeUnpin for ContextLayout
impl !UnwindSafe for ContextLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more