[][src]Struct blend2d::font::Font

#[repr(transparent)]
pub struct Font { /* fields omitted */ }

Font

Methods

impl Font[src]

pub fn from_face(face: &FontFace, size: f32) -> Result<Self>[src]

Creates a new font from the given FontFace.

pub fn face(&self) -> &FontFace[src]

Returns a font-face of the font.

Returns the same font-face, which was passed to from_face.

pub fn face_type(&self) -> FontFaceType[src]

Returns the FontFaceType of the font.

pub fn face_flags(&self) -> FontFaceFlags[src]

Returns the FontFaceFlags of the font.

pub fn units_per_em(&self) -> i32[src]

Returns the "units per em" (UPEM) of the font's associated font-face.

pub fn size(&self) -> f32[src]

Returns the size of the font (as float).

Important traits for Array<u8>
pub fn features(&self) -> &Array<FontFeature>[src]

Returns the font-features used by this font.

Important traits for Array<u8>
pub fn variations(&self) -> &Array<FontVariation>[src]

Returns the font-variations used by this font.

pub fn weight(&self) -> FontWeight[src]

Returns the weight of the font.

pub fn stretch(&self) -> FontStretch[src]

Returns the stretch of the font.

pub fn style(&self) -> FontStyle[src]

Returns the style of the font.

pub fn font_matrix(&self) -> &FontMatrix[src]

Returns a 2x2 matrix of the font.

The returned FontMatrix is used to scale fonts from design units into user units. The matrix usually has a negative value at the 3rd index of the internal array as fonts use a different coordinate system than Blend2D.

pub fn font_metrics(&self) -> &FontMetrics[src]

Returns a scaled metrics of this font.

The returned metrics is a scale of design metrics that match the font size and its options.

pub fn design_metrics(&self) -> &FontDesignMetrics[src]

Returns a design metrics of this font.

The returned metrics is compatible with the metrics of FontFace associated with this font.

pub fn shape(&self, buf: &mut GlyphBuffer) -> Result<()>[src]

pub fn map_text_to_glyphs(
    &self,
    buf: &mut GlyphBuffer
) -> Result<GlyphMappingState>
[src]

pub fn apply_kerning(&self, buf: &mut GlyphBuffer) -> Result<()>[src]

pub fn apply_g_sub(
    &self,
    buf: &mut GlyphBuffer,
    index: usize,
    lookups: usize
) -> Result<()>
[src]

pub fn apply_g_pos(
    &self,
    buf: &mut GlyphBuffer,
    index: usize,
    lookups: usize
) -> Result<()>
[src]

pub fn get_text_metrics(&self, buf: &mut GlyphBuffer) -> Result<TextMetrics>[src]

Trait Implementations

impl Drop for Font[src]

impl PartialEq<Font> for Font[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Clone for Font[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Font[src]

Auto Trait Implementations

impl !Send for Font

impl Unpin for Font

impl !Sync for Font

impl RefUnwindSafe for Font

impl UnwindSafe for Font

Blanket Implementations

impl<T> ArrayType for T where
    T: WrappedBlCore, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]