Trait solstice_glyph::GlyphPositioner [−]
Logic to calculate glyph positioning using Font
,
SectionGeometry
and
SectionText
.
Required methods
pub fn calculate_glyphs<F, S>(
&self,
fonts: &[F],
geometry: &SectionGeometry,
sections: &[S]
) -> Vec<SectionGlyph, Global> where
F: Font,
S: ToSectionText,
&self,
fonts: &[F],
geometry: &SectionGeometry,
sections: &[S]
) -> Vec<SectionGlyph, Global> where
F: Font,
S: ToSectionText,
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.
pub fn bounds_rect(&self, geometry: &SectionGeometry) -> Rect
Return a screen rectangle according to the requested render position and bounds appropriate for the glyph layout.
Provided methods
pub fn recalculate_glyphs<F, S, P>(
&self,
previous: P,
change: GlyphChange,
fonts: &[F],
geometry: &SectionGeometry,
sections: &[S]
) -> Vec<SectionGlyph, Global> where
F: Font,
S: ToSectionText,
P: IntoIterator<Item = SectionGlyph>,
&self,
previous: P,
change: GlyphChange,
fonts: &[F],
geometry: &SectionGeometry,
sections: &[S]
) -> Vec<SectionGlyph, Global> where
F: Font,
S: ToSectionText,
P: IntoIterator<Item = SectionGlyph>,
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> GlyphPositioner for Layout<L> where
L: LineBreaker,
L: LineBreaker,
pub fn calculate_glyphs<F, S>(
&self,
fonts: &[F],
geometry: &SectionGeometry,
sections: &[S]
) -> Vec<SectionGlyph, Global> where
F: Font,
S: ToSectionText,
&self,
fonts: &[F],
geometry: &SectionGeometry,
sections: &[S]
) -> Vec<SectionGlyph, Global> where
F: Font,
S: ToSectionText,
pub fn bounds_rect(&self, geometry: &SectionGeometry) -> Rect
pub fn recalculate_glyphs<F, S, P>(
&self,
previous: P,
change: GlyphChange,
fonts: &[F],
geometry: &SectionGeometry,
sections: &[S]
) -> Vec<SectionGlyph, Global> where
F: Font,
S: ToSectionText,
P: IntoIterator<Item = SectionGlyph>,
&self,
previous: P,
change: GlyphChange,
fonts: &[F],
geometry: &SectionGeometry,
sections: &[S]
) -> Vec<SectionGlyph, Global> where
F: Font,
S: ToSectionText,
P: IntoIterator<Item = SectionGlyph>,