Struct freetype::glyph::Glyph

source ·
pub struct Glyph { /* private fields */ }
Expand description

Represents a retrieved glyph from the library

Note that when this glyph is dropped, so is the library

Implementations§

source§

impl Glyph

source

pub unsafe fn from_raw(library_raw: FT_Library, raw: FT_Glyph) -> Self

Create a freetype-rs glyph object from c constituent parts

source

pub fn transform( &self, matrix: Option<Matrix>, delta: Option<Vector> ) -> FtResult<()>

Transform a glyph image if its format is scalable.

source

pub fn get_cbox(&self, bbox_mode: FT_Glyph_BBox_Mode) -> BBox

Return a glyph’s ‘control box’. The control box encloses all the outline’s points, including Bézier control points. Though it coincides with the exact bounding box for most glyphs, it can be slightly larger in some situations (like when rotating an outline that contains Bézier outside arcs).

Computing the control box is very fast, while getting the bounding box can take much more time as it needs to walk over all segments and arcs in the outline. To get the latter, you can use the ‘ftbbox’ component, which is dedicated to this single task.

source

pub fn to_bitmap( &self, render_mode: RenderMode, origin: Option<Vector> ) -> FtResult<BitmapGlyph>

Convert a given glyph object to a bitmap glyph object.

source

pub fn stroke(&self, stroker: &Stroker) -> FtResult<Glyph>

source

pub fn stroke_border(&self, stroker: &Stroker, inside: bool) -> FtResult<Glyph>

source

pub fn advance_x(&self) -> isize

source

pub fn advance_y(&self) -> isize

source

pub fn format(&self) -> FT_Glyph_Format

An enumeration type used to describe the format of a given glyph image. Note that this version of FreeType only supports two image formats, even though future font drivers will be able to register their own format.

source

pub fn raw(&self) -> &FT_GlyphRec

Get the underlying c glyph struct (The system actually calls this a GlyphRec because it can be a different struct in different circumstances)

Trait Implementations§

source§

impl Clone for Glyph

source§

fn clone(&self) -> Self

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
source§

impl Drop for Glyph

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Glyph

§

impl !Send for Glyph

§

impl !Sync for Glyph

§

impl Unpin for Glyph

§

impl UnwindSafe for Glyph

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.