#[repr(transparent)]pub struct Font { /* private fields */ }
Expand description
A struct representing a font.
Implementations§
source§impl Font
impl Font
sourcepub fn new(bytes: &[u8]) -> Result<Font, BacktraceError<ErrorMessage>>
pub fn new(bytes: &[u8]) -> Result<Font, BacktraceError<ErrorMessage>>
Constructs a new font from the specified bytes.
The font may be in TrueType or OpenType format. Support for OpenType fonts may be limited.
Trait Implementations§
source§impl PartialEq<Font> for Font
impl PartialEq<Font> for Font
source§impl TextLayout for Font
impl TextLayout for Font
source§fn lookup_glyph_for_codepoint(&self, codepoint: char) -> Option<FontGlyph>
fn lookup_glyph_for_codepoint(&self, codepoint: char) -> Option<FontGlyph>
Returns the glyph corresponding to the provided codepoint. If the glyph
cannot be found,
None
is returned.source§fn empty_line_vertical_metrics(&self, scale: f32) -> LineVerticalMetrics
fn empty_line_vertical_metrics(&self, scale: f32) -> LineVerticalMetrics
The default metrics of a line which contains no characters.
source§fn layout_text(
&self,
text: &str,
scale: f32,
options: TextOptions
) -> Rc<FormattedTextBlock>
fn layout_text(
&self,
text: &str,
scale: f32,
options: TextOptions
) -> Rc<FormattedTextBlock>
Lays out a block of text with the specified scale and options. The
result may be passed to
Graphics2D::draw_text
. Read moresource§fn layout_text_from_unindexed_codepoints(
&self,
unindexed_codepoints: &[char],
scale: f32,
options: TextOptions
) -> Rc<FormattedTextBlock>
fn layout_text_from_unindexed_codepoints(
&self,
unindexed_codepoints: &[char],
scale: f32,
options: TextOptions
) -> Rc<FormattedTextBlock>
Lays out a block of text with the specified scale and options. The
result may be passed to
Graphics2D::draw_text
. Read moresource§fn layout_text_from_codepoints(
&self,
codepoints: &[Codepoint],
scale: f32,
options: TextOptions
) -> Rc<FormattedTextBlock>
fn layout_text_from_codepoints(
&self,
codepoints: &[Codepoint],
scale: f32,
options: TextOptions
) -> Rc<FormattedTextBlock>
Lays out a block of text with the specified scale and options. The
result may be passed to
Graphics2D::draw_text
. Read more