Skip to main content

TextLayouter

Struct TextLayouter 

Source
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

Source

pub fn layout( &mut self, input: &LayoutInput<'_>, resolver: &FontFamilyResolver, ) -> TextLayout

Lays input out with the typefaces of resolver.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn rest(&mut self)

The texts rest: gives back the storage for shaped glyphs that a long text took.

Source

pub fn hyphenator_mut(&mut self) -> &mut Hyphenator

The dictionaries Hyphens.Auto hyphenates words by.

Trait Implementations§

Source§

impl Default for TextLayouter

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !Freeze for TextLayouter

§

impl !RefUnwindSafe for TextLayouter

§

impl !Sync for TextLayouter

§

impl !UnwindSafe for TextLayouter

§

impl Forget for TextLayouter

§

impl Move for TextLayouter

§

impl Send for TextLayouter
where RawVecInner: Send, SmallVec<[([u8; 4], f32); 3]>: Send, Arc<SharedFontRepr>: Send, Arc<VariedInstance>: Send, SmallVec<[u8; 8]>: Send, SmallVec<[Feature; 4]>: Send, &'static OtShaper: Send, BoxRaw<[F2Dot14]>: Send, BoxRaw<dyn Any + Send + Sync>: Send, BoxRaw<[u32]>: Send, Atomic<usize>: Send, BoxRaw<[(u32, u32)]>: Send, BoxRaw<[KernSubtable]>: Send, BoxRaw<[u64; 128]>: Send, BoxRaw<[u8; 128]>: Send, InternalBitFlags: Send, &'static RuleBreakData<'static>: Send, &'static DictionaryBreakData<'static>: Send, Arc<[PackedGlyph]>: Send, Arc<[ShapedGlyph]>: Send, Arc<[GlyphOffset]>: Send, SmallVec<[Typeface; 1]>: Send, Cell<Option<(LineBoxInputs, LinePixels)>>: Send, RawTable<(Language, Option<Standard>)>: Send,

§

impl Unpin for TextLayouter
where *const u8 is !null: Unpin, *const ([u8; 4], f32) is !null: Unpin, ([u8; 4], f32): Unpin, Arc<SharedFontRepr>: Unpin, Arc<VariedInstance>: Unpin, u8: Unpin, *const Feature is !null: Unpin, Feature: Unpin, &'static OtShaper: Unpin, Box<[F2Dot14]>: Unpin, Box<dyn Any + Send + Sync>: Unpin, Box<[u32]>: Unpin, Align8<usize>: Unpin, Box<[(u32, u32)]>: Unpin, Box<[KernSubtable]>: Unpin, Box<[u64; 128]>: Unpin, Box<[u8; 128]>: Unpin, InternalBitFlags: Unpin, &'static RuleBreakData<'static>: Unpin, &'static DictionaryBreakData<'static>: Unpin, Arc<[PackedGlyph]>: Unpin, Arc<[ShapedGlyph]>: Unpin, Arc<[GlyphOffset]>: Unpin, Arc<Loaded>: Unpin, *const Typeface is !null: Unpin, Typeface: Unpin,

§

impl UnsafeUnpin for TextLayouter
where *const u8 is !null: UnsafeUnpin, PhantomData<(usize, BidiLevel)>: UnsafeUnpin, PhantomData<(usize, Script)>: UnsafeUnpin, PhantomData<(usize, usize, usize)>: UnsafeUnpin, PhantomData<ShapingFace>: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<GlyphInfo>: UnsafeUnpin, PhantomData<GlyphPosition>: UnsafeUnpin, PhantomData<BitPage>: UnsafeUnpin, PhantomData<PageInfo>: UnsafeUnpin, Align8<usize>: UnsafeUnpin, PhantomData<Feature>: UnsafeUnpin, PhantomData<Option<Word>>: UnsafeUnpin, PhantomData<ShapedGlyph>: UnsafeUnpin, PhantomData<GlyphOffset>: UnsafeUnpin, PhantomData<u64>: UnsafeUnpin, PhantomData<usize>: UnsafeUnpin, PhantomData<(Range<usize>, Range<usize>)>: UnsafeUnpin, &'static RuleBreakData<'static>: UnsafeUnpin, &'static DictionaryBreakData<'static>: UnsafeUnpin, PhantomData<BreakOpportunity>: UnsafeUnpin, PhantomData<f32>: UnsafeUnpin, PhantomData<ShapedItem>: UnsafeUnpin, PhantomData<(u32, f32)>: UnsafeUnpin, PhantomData<BrokenLine>: UnsafeUnpin, PhantomData<Piece>: UnsafeUnpin, *const ArcInner<[PackedGlyph]> is !null: UnsafeUnpin, PhantomData<ArcInner<[PackedGlyph]>>: UnsafeUnpin, *const ArcInner<[ShapedGlyph]> is !null: UnsafeUnpin, PhantomData<ArcInner<[ShapedGlyph]>>: UnsafeUnpin, *const ArcInner<[GlyphOffset]> is !null: UnsafeUnpin, PhantomData<ArcInner<[GlyphOffset]>>: UnsafeUnpin, *const ArcInner<Loaded> is !null: UnsafeUnpin, PhantomData<ArcInner<Loaded>>: UnsafeUnpin, *const Typeface is !null: UnsafeUnpin, PhantomData<Typeface>: UnsafeUnpin, PhantomData<(Language, Option<Standard>)>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.