Struct dotrix_egui::epaint::text::Fonts [−]
pub struct Fonts { /* fields omitted */ }
Expand description
The collection of fonts used by epaint
.
Implementations
impl Fonts
impl Fonts
pub fn from_definitions(
pixels_per_point: f32,
definitions: FontDefinitions
) -> Fonts
pub fn pixels_per_point(&self) -> f32
pub fn definitions(&self) -> &FontDefinitions
pub fn round_to_pixel(&self, point: f32) -> f32
pub fn glyph_width(&self, text_style: TextStyle, c: char) -> f32
pub fn glyph_width(&self, text_style: TextStyle, c: char) -> f32
Width of this character in points.
pub fn row_height(&self, text_style: TextStyle) -> f32
pub fn row_height(&self, text_style: TextStyle) -> f32
Height of one row of text. In points
pub fn layout_no_wrap(&self, text_style: TextStyle, text: String) -> Arc<Galley>
pub fn layout_no_wrap(&self, text_style: TextStyle, text: String) -> Arc<Galley>
Will line break at \n
.
Always returns at least one row.
pub fn layout_single_line(
&self,
text_style: TextStyle,
text: String
) -> Arc<Galley>
pub fn layout_single_line(
&self,
text_style: TextStyle,
text: String
) -> Arc<Galley>
Typeset the given text onto one row.
Any \n
will show up as the replacement character.
Always returns exactly one Row
in the Galley
.
Most often you probably want \n
to produce a new row,
and so Self::layout_no_wrap
may be a better choice.
Will wrap text at the given width and line break at \n
.
Always returns at least one row.
first_row_indentation
: extra space before the very first character (in points).max_width_in_points
: wrapping width.
Always returns at least one row.