pub struct TextLayouter { /* private fields */ }Expand description
Lays paragraphs out. Keeps its itemizer, shaper, line breaker and scratch storage from one layout to the next.
Implementations§
Source§impl TextLayouter
impl TextLayouter
Sourcepub fn layout(
&mut self,
input: &LayoutInput<'_>,
resolver: &FontFamilyResolver,
) -> TextLayout
pub fn layout( &mut self, input: &LayoutInput<'_>, resolver: &FontFamilyResolver, ) -> TextLayout
Lays input out with the typefaces of resolver.
Sourcepub fn relayout(
&mut self,
input: &LayoutInput<'_>,
resolver: &FontFamilyResolver,
shaped: &TextLayout,
) -> TextLayout
pub fn relayout( &mut self, input: &LayoutInput<'_>, resolver: &FontFamilyResolver, shaped: &TextLayout, ) -> TextLayout
Lays input out as TextLayouter::layout does, with the glyphs
shaped placed for the same text in the same typefaces in place of
shaping it again.
Sourcepub fn layout_into(
&mut self,
input: &LayoutInput<'_>,
resolver: &FontFamilyResolver,
layout: &mut TextLayout,
)
pub fn layout_into( &mut self, input: &LayoutInput<'_>, resolver: &FontFamilyResolver, layout: &mut TextLayout, )
Lays input out into layout in place of what it held, in the
storage of its lines and runs when no copy of it shares them.
Sourcepub fn intrinsics(
&mut self,
input: &LayoutInput<'_>,
resolver: &FontFamilyResolver,
) -> ParagraphIntrinsics
pub fn intrinsics( &mut self, input: &LayoutInput<'_>, resolver: &FontFamilyResolver, ) -> ParagraphIntrinsics
The intrinsic widths of input, laid out with the typefaces of
resolver; its width and options do not count.
Sourcepub fn set_memory_headroom(&mut self, headroom: MemoryHeadroom)
pub fn set_memory_headroom(&mut self, headroom: MemoryHeadroom)
Sizes the caches the layouter keeps by how much memory the device has left: tight memory takes them back to their least.
Sourcepub fn begin_pass(&mut self, headroom: MemoryHeadroom)
pub fn begin_pass(&mut self, headroom: MemoryHeadroom)
Begins a layout pass, as a frame’s first layout does: sizes the
caches as TextLayouter::set_memory_headroom does, and gives back
the storage for shaped glyphs past twice what the last pass needed,
so a long paragraph laid out each frame keeps it.
Sourcepub fn rest(&mut self)
pub fn rest(&mut self)
The texts rest: gives back the storage for shaped glyphs that a long text took.
Sourcepub fn hyphenator_mut(&mut self) -> &mut Hyphenator
pub fn hyphenator_mut(&mut self) -> &mut Hyphenator
The dictionaries Hyphens.Auto hyphenates words by.