pub struct RawFace<'a> {
pub data: &'a [u8],
pub table_records: LazyArray16<'a, TableRecord>,
}
Expand description
A raw font face.
You are probably looking for Face
. This is a low-level type.
Unlike Face
, RawFace
parses only face table records.
Meaning all you can get from this type is a raw (&[u8]
) data of a requested table.
Then you can either parse just a singe table from a font/face or populate RawFaceTables
manually before passing it to Face::from_raw_tables
.
Fields§
§data: &'a [u8]
The input font file data.
table_records: LazyArray16<'a, TableRecord>
An array of table records.
Implementations§
source§impl<'a> RawFace<'a>
impl<'a> RawFace<'a>
sourcepub fn from_slice(
data: &'a [u8],
index: u32,
) -> Result<RawFace<'a>, FaceParsingError>
👎Deprecated since 0.16.0: use parse
instead
pub fn from_slice( data: &'a [u8], index: u32, ) -> Result<RawFace<'a>, FaceParsingError>
parse
insteadCreates a new RawFace
from a raw data.
index
indicates the specific font face in a font collection.
Use fonts_in_collection
to get the total number of font faces.
Set to 0 if unsure.
While we do reuse FaceParsingError
, No*Table
errors will not be throws.
sourcepub fn parse(
data: &'a [u8],
index: u32,
) -> Result<RawFace<'a>, FaceParsingError>
pub fn parse( data: &'a [u8], index: u32, ) -> Result<RawFace<'a>, FaceParsingError>
Creates a new RawFace
from a raw data.
index
indicates the specific font face in a font collection.
Use fonts_in_collection
to get the total number of font faces.
Set to 0 if unsure.
While we do reuse FaceParsingError
, No*Table
errors will not be throws.
Trait Implementations§
impl<'a> Copy for RawFace<'a>
Auto Trait Implementations§
impl<'a> Freeze for RawFace<'a>
impl<'a> RefUnwindSafe for RawFace<'a>
impl<'a> Send for RawFace<'a>
impl<'a> Sync for RawFace<'a>
impl<'a> Unpin for RawFace<'a>
impl<'a> UnwindSafe for RawFace<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)