FontFace

Struct FontFace 

Source
pub struct FontFace { /* private fields */ }

Implementations§

Source§

impl FontFace

Source

pub fn take(native: ComPtr<IDWriteFontFace>) -> FontFace

Source

pub unsafe fn as_ptr(&self) -> *mut IDWriteFontFace

Source

pub fn get_files(&self) -> Vec<FontFile>

👎Deprecated: Use files instead.
Source

pub fn files(&self) -> Result<Vec<FontFile>, HRESULT>

Source

pub fn create_font_face_with_simulations( &self, simulations: DWRITE_FONT_SIMULATIONS, ) -> FontFace

Source

pub fn get_glyph_count(&self) -> u16

Source

pub fn metrics(&self) -> FontMetrics

Source

pub fn get_glyph_indices(&self, code_points: &[u32]) -> Vec<u16>

👎Deprecated: Use glyph_indices instead.
Source

pub fn glyph_indices(&self, code_points: &[u32]) -> Result<Vec<u16>, HRESULT>

Source

pub fn get_design_glyph_metrics( &self, glyph_indices: &[u16], is_sideways: bool, ) -> Vec<DWRITE_GLYPH_METRICS>

👎Deprecated: Use design_glyph_metrics instead.
Source

pub fn design_glyph_metrics( &self, glyph_indices: &[u16], is_sideways: bool, ) -> Result<Vec<DWRITE_GLYPH_METRICS>, HRESULT>

Source

pub fn get_gdi_compatible_glyph_metrics( &self, em_size: f32, pixels_per_dip: f32, transform: *const DWRITE_MATRIX, use_gdi_natural: bool, glyph_indices: &[u16], is_sideways: bool, ) -> Vec<DWRITE_GLYPH_METRICS>

👎Deprecated: Use gdi_compatible_glyph_metrics instead.
Source

pub fn gdi_compatible_glyph_metrics( &self, em_size: f32, pixels_per_dip: f32, transform: *const DWRITE_MATRIX, use_gdi_natural: bool, glyph_indices: &[u16], is_sideways: bool, ) -> Result<Vec<DWRITE_GLYPH_METRICS>, HRESULT>

Source

pub fn get_font_table(&self, opentype_table_tag: u32) -> Option<Vec<u8>>

👎Deprecated: Use font_table instead.
Source

pub fn font_table( &self, opentype_table_tag: u32, ) -> Result<Option<Vec<u8>>, HRESULT>

Returns the contents of the OpenType table with the given tag.

NB: The bytes of the tag are reversed! You probably want to use the u32::swap_bytes() method on the tag value before calling this method.

Source

pub fn get_glyph_run_outline( &self, em_size: f32, glyph_indices: &[u16], glyph_advances: Option<&[f32]>, glyph_offsets: Option<&[DWRITE_GLYPH_OFFSET]>, is_sideways: bool, is_right_to_left: bool, outline_builder: Box<dyn OutlineBuilder>, )

👎Deprecated: Use glyph_run_outline instead.
Source

pub fn glyph_run_outline( &self, em_size: f32, glyph_indices: &[u16], glyph_advances: Option<&[f32]>, glyph_offsets: Option<&[DWRITE_GLYPH_OFFSET]>, is_sideways: bool, is_right_to_left: bool, outline_builder: Box<dyn OutlineBuilder>, ) -> Result<(), GlyphRunOutlineError>

Source

pub fn has_kerning_pairs(&self) -> bool

Source

pub fn get_glyph_pair_kerning_adjustment( &self, first_glyph: u16, second_glyph: u16, ) -> i32

👎Deprecated: Use glyph_pair_kerning_adjustment instead.
Source

pub fn glyph_pair_kerning_adjustment( &self, first_glyph: u16, second_glyph: u16, ) -> Result<i32, HRESULT>

Source

pub fn get_type(&self) -> FontFaceType

Source

pub fn get_index(&self) -> u32

Source

pub fn has_variations(&self) -> bool

Source

pub fn variations(&self) -> Result<Vec<DWRITE_FONT_AXIS_VALUE>, HRESULT>

If this font has variations, return a [Vec<DWRITE_FONT_AXIS_VALUE] of the variation axes and their values. If the font does not have variations, return an empty Vec.

Source

pub fn create_font_face_with_variations( &self, simulations: DWRITE_FONT_SIMULATIONS, axis_values: &[DWRITE_FONT_AXIS_VALUE], ) -> Option<FontFace>

Source

pub fn simulations(&self) -> FontSimulations

Trait Implementations§

Source§

impl Clone for FontFace

Source§

fn clone(&self) -> FontFace

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

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

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.