Type Alias Font

pub type Font = Handle<SkFont>;

Aliased Type§

struct Font(/* private fields */);

Implementations

§

impl Handle<SkFont>

pub fn new( typeface: impl Into<RCHandle<SkTypeface>>, size: impl Into<Option<f32>>, ) -> Handle<SkFont>

pub fn from_typeface( typeface: impl Into<RCHandle<SkTypeface>>, size: impl Into<Option<f32>>, ) -> Handle<SkFont>

pub fn from_typeface_with_params( typeface: impl Into<RCHandle<SkTypeface>>, size: f32, scale: f32, skew: f32, ) -> Handle<SkFont>

pub fn is_force_auto_hinting(&self) -> bool

pub fn is_embedded_bitmaps(&self) -> bool

pub fn is_subpixel(&self) -> bool

pub fn is_linear_metrics(&self) -> bool

pub fn is_embolden(&self) -> bool

pub fn is_baseline_snap(&self) -> bool

pub fn set_force_auto_hinting( &mut self, force_auto_hinting: bool, ) -> &mut Handle<SkFont>

pub fn set_embedded_bitmaps( &mut self, embedded_bitmaps: bool, ) -> &mut Handle<SkFont>

pub fn set_subpixel(&mut self, subpixel: bool) -> &mut Handle<SkFont>

pub fn set_linear_metrics( &mut self, linear_metrics: bool, ) -> &mut Handle<SkFont>

pub fn set_embolden(&mut self, embolden: bool) -> &mut Handle<SkFont>

pub fn set_baseline_snap(&mut self, baseline_snap: bool) -> &mut Handle<SkFont>

pub fn edging(&self) -> SkFont_Edging

pub fn set_edging(&mut self, edging: SkFont_Edging) -> &mut Handle<SkFont>

pub fn set_hinting(&mut self, hinting: SkFontHinting) -> &mut Handle<SkFont>

pub fn hinting(&self) -> SkFontHinting

pub fn with_size(&self, size: f32) -> Option<Handle<SkFont>>

pub fn typeface(&self) -> RCHandle<SkTypeface>

pub fn size(&self) -> f32

pub fn scale_x(&self) -> f32

pub fn skew_x(&self) -> f32

pub fn set_typeface( &mut self, tf: impl Into<RCHandle<SkTypeface>>, ) -> &mut Handle<SkFont>

pub fn set_size(&mut self, size: f32) -> &mut Handle<SkFont>

pub fn set_scale_x(&mut self, scale_x: f32) -> &mut Handle<SkFont>

pub fn set_skew_x(&mut self, skew_x: f32) -> &mut Handle<SkFont>

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

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

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

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

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

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

pub fn measure_str( &self, str: impl AsRef<str>, paint: Option<&Handle<SkPaint>>, ) -> (f32, Rect)

pub fn measure_text( &self, text: impl EncodedText, paint: Option<&Handle<SkPaint>>, ) -> (f32, Rect)

pub fn unichar_to_glyph(&self, uni: i32) -> u16

pub fn unichar_to_glyphs(&self, uni: &[i32], glyphs: &mut [u16])

pub fn get_widths(&self, glyphs: &[u16], widths: &mut [f32])

pub fn get_widths_bounds( &self, glyphs: &[u16], widths: Option<&mut [f32]>, bounds: Option<&mut [Rect]>, paint: Option<&Handle<SkPaint>>, )

pub fn get_bounds( &self, glyphs: &[u16], bounds: &mut [Rect], paint: Option<&Handle<SkPaint>>, )

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

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

pub fn get_intercepts<'a>( &self, glyphs: &[u16], pos: &[Point], _: (f32, f32), paint: impl Into<Option<&'a Handle<SkPaint>>>, ) -> Vec<f32>

pub fn get_path(&self, glyph_id: u16) -> Option<Handle<SkPath>>

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

pub fn spacing(&self) -> f32

Trait Implementations

§

impl<N> AsRef<Handle<N>> for Handle<N>
where N: NativeDrop,

§

fn as_ref(&self) -> &Handle<N>

Converts this type into a shared reference of the (usually inferred) input type.
§

impl<N> Clone for Handle<N>
where N: NativeDrop + NativeClone,

§

fn clone(&self) -> Handle<N>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Handle<SkFont>

§

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

Formats the value using the given formatter. Read more
§

impl Default for Handle<SkFont>

§

fn default() -> Handle<SkFont>

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

impl<N> Drop for Handle<N>
where N: NativeDrop,

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

impl<N> Hash for Handle<N>
where N: NativeDrop + NativeHash,

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<N> PartialEq for Handle<N>
where N: NativeDrop + NativePartialEq,

§

fn eq(&self, rhs: &Handle<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<N> RefWrapper<N> for Handle<N>
where N: NativeDrop,

§

fn wrap_ref(native: &N) -> &Handle<N>

§

fn wrap_mut(native: &mut N) -> &mut Handle<N>

§

fn inner(&self) -> &N

§

fn inner_mut(&mut self) -> &mut N

§

impl<N> ValueWrapper<N> for Handle<N>
where N: NativeDrop,

§

fn wrap(native: N) -> Handle<N>
where N: NativeDrop,

§

fn unwrap(self) -> N

§

fn inner(&self) -> &N

§

fn inner_mut(&mut self) -> &mut N

§

impl Send for Handle<SkFont>

§

impl Sync for Handle<SkFont>