Type Definition skia_safe::Font

source ·
pub type Font = Handle<SkFont>;

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) -> Option<Typeface>

source

pub fn typeface_or_default(&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: &[u8], encoding: TextEncoding, glyphs: &mut [GlyphId] ) -> usize

source

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

source

pub fn count_text(&self, text: &[u8], encoding: TextEncoding) -> usize

source

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

source

pub fn text_to_glyphs_vec( &self, text: &[u8], encoding: TextEncoding ) -> Vec<GlyphId>

source

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

source

pub fn measure_text( &self, text: &[u8], encoding: TextEncoding, 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