pub struct Font {
pub flags: u16,
pub upem: i32,
pub asc: i32,
pub desc: i32,
pub gap: i32,
pub caph: i32,
pub xh: i32,
pub ulpos: i32,
pub ulthick: i32,
pub nglyphs: u32,
pub fallback: u32,
/* private fields */
}Fields§
§flags: u16§upem: i32§asc: i32§desc: i32§gap: i32§caph: i32§xh: i32§ulpos: i32§ulthick: i32§nglyphs: u32§fallback: u32Implementations§
Source§impl Font
impl Font
Sourcepub fn parse(data: &'static [u8]) -> Option<Font>
pub fn parse(data: &'static [u8]) -> Option<Font>
font_register’s parse: None when the data is not SGF1
pub fn new(data: &'static [u8]) -> Font
pub fn hdr(&self) -> Hdr
Sourcepub fn lookup(&self, cp: u32) -> Option<u32>
pub fn lookup(&self, cp: u32) -> Option<u32>
binary search over the ranges {u32 firstCp, u16 count, u16 firstGlyph} [font_lookup]
pub fn glyph(&self, cp: u32) -> u32
pub fn adv(&self, g: u32) -> i32
Sourcepub fn kern(&self, g1: u32, g2: u32) -> i32
pub fn kern(&self, g1: u32, g2: u32) -> i32
kern(l, r) = matrix[lclass[l] * kernR + rclass[r]] * 4 font units
pub fn glyph_box(&self, g: u32) -> Option<[i32; 4]>
Auto Trait Implementations§
impl Forget for Font
impl Freeze for Font
impl RefUnwindSafe for Font
impl Send for Font
impl Sync for Font
impl Unpin for Font
impl UnsafeUnpin for Font
impl UnwindSafe for Font
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
Mutably borrows from an owned value. Read more