Skip to main content

text_typeset/shaping/
run.rs

1use std::ops::Range;
2
3use crate::types::FontFaceId;
4
5#[derive(Clone)]
6pub struct ShapedGlyph {
7    pub glyph_id: u16,
8    pub cluster: u32,
9    pub x_advance: f32,
10    pub y_advance: f32,
11    pub x_offset: f32,
12    pub y_offset: f32,
13    /// Font face for this specific glyph. May differ from the run's font_face_id
14    /// when glyph fallback replaced a .notdef with a glyph from another font.
15    pub font_face_id: FontFaceId,
16}
17
18#[derive(Clone)]
19pub struct ShapedRun {
20    pub font_face_id: FontFaceId,
21    pub size_px: f32,
22    pub glyphs: Vec<ShapedGlyph>,
23    pub advance_width: f32,
24    pub text_range: Range<usize>,
25    /// Decoration flags from the source fragment's TextFormat.
26    pub underline: bool,
27    pub overline: bool,
28    pub strikeout: bool,
29    pub is_link: bool,
30}