pub struct PositionedGlyph {
pub id: GlyphId,
pub text: String,
pub font: ID,
/* private fields */
}
Expand description
A glyph that has already been positioned correctly.
Note that the transform already takes the font size into consideration, so applying the transform to the outline of the glyphs is all that is necessary to display it correctly.
Fields§
§id: GlyphId
The ID of the glyph.
text: String
The text from the original string that corresponds to that glyph.
font: ID
The ID of the font the glyph should be taken from. Can be used with the font database of the tree this glyph is part of.
Implementations§
source§impl PositionedGlyph
impl PositionedGlyph
sourcepub fn outline_transform(&self) -> Transform
pub fn outline_transform(&self) -> Transform
Returns the transform of glyph, assuming that an outline
glyph is being used (i.e. from the glyf
or CFF/CFF2
table).
sourcepub fn cbdt_transform(
&self,
x: f32,
y: f32,
pixels_per_em: f32,
height: f32,
) -> Transform
pub fn cbdt_transform( &self, x: f32, y: f32, pixels_per_em: f32, height: f32, ) -> Transform
Returns the transform for the glyph, assuming that a CBTD-based raster glyph is being used.
sourcepub fn sbix_transform(
&self,
x: f32,
y: f32,
x_min: f32,
y_min: f32,
pixels_per_em: f32,
height: f32,
) -> Transform
pub fn sbix_transform( &self, x: f32, y: f32, x_min: f32, y_min: f32, pixels_per_em: f32, height: f32, ) -> Transform
Returns the transform for the glyph, assuming that a sbix-based raster glyph is being used.
sourcepub fn svg_transform(&self) -> Transform
pub fn svg_transform(&self) -> Transform
Returns the transform for the glyph, assuming that an SVG glyph is being used.
sourcepub fn colr_transform(&self) -> Transform
pub fn colr_transform(&self) -> Transform
Returns the transform for the glyph, assuming that a COLR glyph is being used.
Trait Implementations§
source§impl Clone for PositionedGlyph
impl Clone for PositionedGlyph
source§fn clone(&self) -> PositionedGlyph
fn clone(&self) -> PositionedGlyph
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for PositionedGlyph
impl RefUnwindSafe for PositionedGlyph
impl Send for PositionedGlyph
impl Sync for PositionedGlyph
impl Unpin for PositionedGlyph
impl UnwindSafe for PositionedGlyph
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)