pub struct Font {
lib: Rc<FontLibrary>,
face: *mut FtFace,
font: *mut HbFont,
size: u32,
dpi: u16,
pub ellipsis: RenderPlan,
pub x_heights: (u32, u32),
space_codepoint: u32,
}Fields§
§lib: Rc<FontLibrary>§face: *mut FtFace§font: *mut HbFont§size: u32§dpi: u16§ellipsis: RenderPlan§x_heights: (u32, u32)§space_codepoint: u32Implementations§
Source§impl Font
impl Font
pub fn family_name(&self) -> Option<&str>
pub fn style_name(&self) -> Option<&str>
pub fn set_size(&mut self, size: u32, dpi: u16)
pub fn set_variations(&mut self, specs: &[&str])
pub fn set_variations_from_name(&mut self, name: &str) -> bool
unsafe fn patch( &mut self, txt: &str, features: &[HbFeature], render_plan: &mut RenderPlan, missing_glyphs: Vec<(usize, usize)>, buf: *mut HbBuffer, )
pub fn plan<S: AsRef<str>>( &mut self, text: S, max_width: Option<i32>, features: Option<&[String]>, ) -> RenderPlan
pub fn crop_right(&self, render_plan: &mut RenderPlan, max_width: i32)
pub fn trim_left(&self, render_plan: &mut RenderPlan)
pub fn crop_around( &self, render_plan: &mut RenderPlan, index: usize, max_width: i32, ) -> usize
pub fn cut_point( &self, render_plan: &RenderPlan, max_width: i32, ) -> (usize, i32)
pub fn render( &mut self, fb: &mut dyn Framebuffer, color: Color, render_plan: &RenderPlan, origin: Point, )
pub fn height(&self, c: char) -> u32
pub fn em(&self) -> u16
pub fn ascender(&self) -> i32
pub fn descender(&self) -> i32
pub fn line_height(&self) -> i32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Font
impl RefUnwindSafe for Font
impl !Send for Font
impl !Sync for Font
impl Unpin 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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.