[−][src]Trait glyph_brush_layout::GlyphPositioner
Logic to calculate glyph positioning using Font
,
SectionGeometry
and
SectionText
.
Required methods
fn calculate_glyphs<'font, F: FontMap<'font>>(
&self,
fonts: &F,
geometry: &SectionGeometry,
sections: &[SectionText]
) -> Vec<(PositionedGlyph<'font>, Color, FontId)>
&self,
fonts: &F,
geometry: &SectionGeometry,
sections: &[SectionText]
) -> Vec<(PositionedGlyph<'font>, Color, FontId)>
Calculate a sequence of positioned glyphs to render. Custom implementations should return the same result when called with the same arguments to allow layout caching.
fn bounds_rect(&self, geometry: &SectionGeometry) -> Rect<f32>
Return a screen rectangle according to the requested render position and bounds appropriate for the glyph layout.
Provided methods
fn recalculate_glyphs<'font, F>(
&self,
previous: Cow<Vec<(PositionedGlyph<'font>, Color, FontId)>>,
change: GlyphChange,
fonts: &F,
geometry: &SectionGeometry,
sections: &[SectionText]
) -> Vec<(PositionedGlyph<'font>, Color, FontId)> where
F: FontMap<'font>,
&self,
previous: Cow<Vec<(PositionedGlyph<'font>, Color, FontId)>>,
change: GlyphChange,
fonts: &F,
geometry: &SectionGeometry,
sections: &[SectionText]
) -> Vec<(PositionedGlyph<'font>, Color, FontId)> where
F: FontMap<'font>,
Recalculate a glyph sequence after a change.
The default implementation simply calls calculate_glyphs
so must be implemented
to provide benefits as such benefits are spefic to the internal layout logic.
Implementors
impl<L: LineBreaker> GlyphPositioner for Layout<L>
[src]
fn calculate_glyphs<'font, F: FontMap<'font>>(
&self,
font_map: &F,
geometry: &SectionGeometry,
sections: &[SectionText]
) -> Vec<(PositionedGlyph<'font>, Color, FontId)>
[src]
&self,
font_map: &F,
geometry: &SectionGeometry,
sections: &[SectionText]
) -> Vec<(PositionedGlyph<'font>, Color, FontId)>
fn bounds_rect(&self, geometry: &SectionGeometry) -> Rect<f32>
[src]
fn recalculate_glyphs<'font, F>(
&self,
previous: Cow<Vec<(PositionedGlyph<'font>, Color, FontId)>>,
change: GlyphChange,
fonts: &F,
geometry: &SectionGeometry,
sections: &[SectionText]
) -> Vec<(PositionedGlyph<'font>, Color, FontId)> where
F: FontMap<'font>,
[src]
&self,
previous: Cow<Vec<(PositionedGlyph<'font>, Color, FontId)>>,
change: GlyphChange,
fonts: &F,
geometry: &SectionGeometry,
sections: &[SectionText]
) -> Vec<(PositionedGlyph<'font>, Color, FontId)> where
F: FontMap<'font>,