[−][src]Struct harfbuzz_rs::Face
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.
Methods
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]
path: P,
index: u32
) -> Result<Owned<Face<'static>>>
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]
F: 'b + Send + Sync + FnMut(Tag) -> Option<Shared<Blob<'b>>>,
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: 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> HarfbuzzObject for Face<'a>
[src]
type Raw = hb_face_t
Type of the raw harfbuzz object.
unsafe fn from_raw(raw: *const hb_face_t) -> Self
[src]
fn as_raw(&self) -> *mut Self::Raw
[src]
unsafe fn reference(&self)
[src]
unsafe fn dereference(&self)
[src]
impl<'a> Send for Face<'a>
[src]
impl<'a> Sync for Face<'a>
[src]
impl<'a> Debug for Face<'a>
[src]
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,