[][src]Struct harfbuzz_rs::Face

pub struct Face<'a> { /* fields omitted */ }

A wrapper around hb_face_t.

An excerpt from harfbuzz documentation:

Font face is objects represent a single face in a font family. More exactly, a font face represents a single face in a binary font file. Font faces are typically built from a binary blob and a face index. Font faces are used to create fonts.

Implementations

impl<'a> Face<'a>[src]

pub fn new<T: Into<Shared<Blob<'a>>>>(data: T, index: u32) -> Owned<Face<'a>>[src]

Create a new Face from the data.

If data is not a valid font then this function returns the empty face.

pub fn empty() -> Owned<Face<'static>>[src]

Returns a "null" face.

pub fn from_file<P: AsRef<Path>>(
    path: P,
    index: u32
) -> Result<Owned<Face<'static>>>
[src]

Create a new face from the contents of the file at path.

This function reads the contents of the file at path into memory, creates a Blob and then calls Face::new.

See also the discussion in Blob::from_file.

pub fn from_bytes<'b>(bytes: &'b [u8], index: u32) -> Owned<Face<'b>>[src]

Create a face from the bytes of a given slice and an index specifying which font to read from an OpenType font collection.

pub fn from_table_func<'b, F>(func: F) -> Owned<Face<'b>> where
    F: 'b + Send + Sync + FnMut(Tag) -> Option<Shared<Blob<'b>>>, 
[src]

Create a new face from a closure that returns a raw Blob of table data.

pub fn face_data(&self) -> Shared<Blob<'a>>[src]

pub fn table_with_tag(&self, tag: impl Into<Tag>) -> Option<Shared<Blob<'a>>>[src]

Returns the slice of bytes for the table named tag or None if there is no table with tag.

pub fn index(&self) -> u32[src]

pub fn set_upem(&mut self, upem: u32)[src]

pub fn upem(&self) -> u32[src]

pub fn set_glyph_count(&mut self, count: u32)[src]

pub fn glyph_count(&self) -> u32[src]

Returns the number of glyphs contained in the face.

Trait Implementations

impl<'a> Debug for Face<'a>[src]

impl<'a> HarfbuzzObject for Face<'a>[src]

type Raw = hb_face_t

Type of the raw harfbuzz object.

impl<'a> Send for Face<'a>[src]

impl<'a> Sync for Face<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Face<'a>

impl<'a> Unpin for Face<'a>

impl<'a> UnwindSafe for Face<'a>

Blanket Implementations

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

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

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

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

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

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.