skia_safe

Type Alias Font

Source
pub type Font = Handle<SkFont>;

Aliased Type§

struct Font(/* private fields */);

Implementations§

Source§

impl Font

Source

pub fn new( typeface: impl Into<Typeface>, size: impl Into<Option<scalar>>, ) -> Self

Source

pub fn from_typeface( typeface: impl Into<Typeface>, size: impl Into<Option<scalar>>, ) -> Self

Source

pub fn from_typeface_with_params( typeface: impl Into<Typeface>, size: scalar, scale: scalar, skew: scalar, ) -> Self

Source

pub fn is_force_auto_hinting(&self) -> bool

Source

pub fn is_embedded_bitmaps(&self) -> bool

Source

pub fn is_subpixel(&self) -> bool

Source

pub fn is_linear_metrics(&self) -> bool

Source

pub fn is_embolden(&self) -> bool

Source

pub fn is_baseline_snap(&self) -> bool

Source

pub fn set_force_auto_hinting(&mut self, force_auto_hinting: bool) -> &mut Self

Source

pub fn set_embedded_bitmaps(&mut self, embedded_bitmaps: bool) -> &mut Self

Source

pub fn set_subpixel(&mut self, subpixel: bool) -> &mut Self

Source

pub fn set_linear_metrics(&mut self, linear_metrics: bool) -> &mut Self

Source

pub fn set_embolden(&mut self, embolden: bool) -> &mut Self

Source

pub fn set_baseline_snap(&mut self, baseline_snap: bool) -> &mut Self

Source

pub fn edging(&self) -> Edging

Source

pub fn set_edging(&mut self, edging: Edging) -> &mut Self

Source

pub fn set_hinting(&mut self, hinting: FontHinting) -> &mut Self

Source

pub fn hinting(&self) -> FontHinting

Source

pub fn with_size(&self, size: scalar) -> Option<Self>

Source

pub fn typeface(&self) -> Typeface

Source

pub fn size(&self) -> scalar

Source

pub fn scale_x(&self) -> scalar

Source

pub fn skew_x(&self) -> scalar

Source

pub fn set_typeface(&mut self, tf: impl Into<Typeface>) -> &mut Self

Source

pub fn set_size(&mut self, size: scalar) -> &mut Self

Source

pub fn set_scale_x(&mut self, scale_x: scalar) -> &mut Self

Source

pub fn set_skew_x(&mut self, skew_x: scalar) -> &mut Self

Source

pub fn str_to_glyphs( &self, str: impl AsRef<str>, glyphs: &mut [GlyphId], ) -> usize

Source

pub fn text_to_glyphs( &self, text: impl EncodedText, glyphs: &mut [GlyphId], ) -> usize

Source

pub fn count_str(&self, str: impl AsRef<str>) -> usize

Source

pub fn count_text(&self, text: impl EncodedText) -> usize

Source

pub fn str_to_glyphs_vec(&self, str: impl AsRef<str>) -> Vec<GlyphId>

Source

pub fn text_to_glyphs_vec(&self, text: impl EncodedText) -> Vec<GlyphId>

Source

pub fn measure_str( &self, str: impl AsRef<str>, paint: Option<&Paint>, ) -> (scalar, Rect)

Source

pub fn measure_text( &self, text: impl EncodedText, paint: Option<&Paint>, ) -> (scalar, Rect)

Source

pub fn unichar_to_glyph(&self, uni: Unichar) -> GlyphId

Source

pub fn unichar_to_glyphs(&self, uni: &[Unichar], glyphs: &mut [GlyphId])

Source

pub fn get_widths(&self, glyphs: &[GlyphId], widths: &mut [scalar])

Source

pub fn get_widths_bounds( &self, glyphs: &[GlyphId], widths: Option<&mut [scalar]>, bounds: Option<&mut [Rect]>, paint: Option<&Paint>, )

Source

pub fn get_bounds( &self, glyphs: &[GlyphId], bounds: &mut [Rect], paint: Option<&Paint>, )

Source

pub fn get_pos( &self, glyphs: &[GlyphId], pos: &mut [Point], origin: Option<Point>, )

Source

pub fn get_x_pos( &self, glyphs: &[GlyphId], x_pos: &mut [scalar], origin: Option<scalar>, )

Source

pub fn get_intercepts<'a>( &self, glyphs: &[GlyphId], pos: &[Point], (top, bottom): (scalar, scalar), paint: impl Into<Option<&'a Paint>>, ) -> Vec<scalar>

Source

pub fn get_path(&self, glyph_id: GlyphId) -> Option<Path>

Source

pub fn metrics(&self) -> (scalar, FontMetrics)

Source

pub fn spacing(&self) -> scalar

Trait Implementations§

Source§

impl Debug for Font

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Font

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Send for Font

Source§

impl Sync for Font