pub struct LayoutGlyph {Show 15 fields
pub start: usize,
pub end: usize,
pub font_size: f32,
pub line_height_opt: Option<f32>,
pub font_id: ID,
pub glyph_id: u16,
pub x: f32,
pub y: f32,
pub w: f32,
pub level: Level,
pub x_offset: f32,
pub y_offset: f32,
pub color_opt: Option<Color>,
pub metadata: usize,
pub cache_key_flags: CacheKeyFlags,
}
Expand description
A laid out glyph
Fields§
§start: usize
Start index of cluster in original line
end: usize
End index of cluster in original line
font_size: f32
Font size of the glyph
line_height_opt: Option<f32>
Line height of the glyph, will override buffer setting
font_id: ID
Font id of the glyph
glyph_id: u16
Font id of the glyph
x: f32
X offset of hitbox
y: f32
Y offset of hitbox
w: f32
Width of hitbox
level: Level
Unicode BiDi embedding level, character is left-to-right if level
is divisible by 2
x_offset: f32
X offset in line
If you are dealing with physical coordinates, use Self::physical
to obtain a
PhysicalGlyph
for rendering.
This offset is useful when you are dealing with logical units and you do not care or cannot guarantee pixel grid alignment. For instance, when you want to use the glyphs for vectorial text, apply linear transformations to the layout, etc.
y_offset: f32
Y offset in line
If you are dealing with physical coordinates, use Self::physical
to obtain a
PhysicalGlyph
for rendering.
This offset is useful when you are dealing with logical units and you do not care or cannot guarantee pixel grid alignment. For instance, when you want to use the glyphs for vectorial text, apply linear transformations to the layout, etc.
color_opt: Option<Color>
Optional color override
metadata: usize
Metadata from Attrs
cache_key_flags: CacheKeyFlags
Implementations§
source§impl LayoutGlyph
impl LayoutGlyph
Trait Implementations§
source§impl Clone for LayoutGlyph
impl Clone for LayoutGlyph
source§fn clone(&self) -> LayoutGlyph
fn clone(&self) -> LayoutGlyph
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 LayoutGlyph
impl RefUnwindSafe for LayoutGlyph
impl Send for LayoutGlyph
impl Sync for LayoutGlyph
impl Unpin for LayoutGlyph
impl UnwindSafe for LayoutGlyph
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
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more