pub struct GlyphInstance {
pub face_id: u64,
pub font_index: u32,
pub glyph_id: u32,
pub px_size: u16,
pub x: f32,
pub y: f32,
pub color: Option<Color>,
}Expand description
One positioned glyph in logical layout space.
The matching font bytes remain owned by crate::TextSystem. Coordinates
are logical pixels relative to the layout origin; they are not rounded to
device pixels. color is absent for layouts that use one caller-supplied
paint color and present for styled runs that carry their own color.
§Examples
use ailloli_ui_text::GlyphInstance;
let glyph = GlyphInstance {
face_id: 7,
font_index: 0,
glyph_id: 42,
px_size: 16,
x: 12.5,
y: 20.0,
color: None,
};
assert_eq!(glyph.glyph_id, 42);
assert_eq!(glyph.color, None);Fields§
§face_id: u64Stable identifier of the selected font face within the Parley database.
font_index: u32Face index inside a font collection; zero for ordinary single-face fonts.
glyph_id: u32Font-specific glyph identifier used for rasterization.
px_size: u16Requested font size in logical pixels, rounded and clamped to at least one.
x: f32Horizontal glyph origin in logical pixels.
y: f32Vertical glyph origin in logical pixels.
color: Option<Color>Per-run linear-RGBA color, or None when paint supplies a uniform color.
Trait Implementations§
Source§impl Clone for GlyphInstance
impl Clone for GlyphInstance
Source§fn clone(&self) -> GlyphInstance
fn clone(&self) -> GlyphInstance
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more