drawing_api/common/display_list/text/
paragraph.rs1use super::Range;
2
3pub trait Paragraph: 'static {
4 type GlyphInfo: crate::GlyphInfo;
5 type LineMetrics: crate::LineMetrics;
6
7 fn get_max_width(&self) -> f32;
8
9 fn get_height(&self) -> f32;
10
11 fn get_longest_line_width(&self) -> f32;
12
13 fn get_min_intrinsic_width(&self) -> f32;
14
15 fn get_max_intrinsic_width(&self) -> f32;
16
17 fn get_ideographic_baseline(&self) -> f32;
18
19 fn get_alphabetic_baseline(&self) -> f32;
20
21 fn get_line_count(&self) -> u32;
22
23 fn get_line_metrics(&self) -> Option<Self::LineMetrics>;
24
25 fn get_word_boundary_utf16(&self, code_unit_index: usize) -> Range;
26
27 fn create_glyph_info_at_code_unit_index_utf16(
28 &self,
29 code_unit_index: usize,
30 ) -> Option<Self::GlyphInfo>;
31
32 fn create_glyph_info_at_paragraph_coordinates(&self, x: f64, y: f64)
33 -> Option<Self::GlyphInfo>;
34}