Struct harfbuzz_rs::Font
[−]
[src]
#[repr(C)]pub struct Font<'a> { /* fields omitted */ }
A font is the most important concept in harfbuzz.
A font can be created either as a subfont of an existing font or directly from a Face
using
its create_font
function.
Methods
impl<'a> Font<'a>
[src]
pub fn new<T: Into<Shared<Face<'a>>>>(face: T) -> Owned<Self>
[src]
Create a new font with a specified Face
.
pub fn create_sub_font<T: Into<Shared<Font<'a>>>>(font: T) -> Owned<Font<'a>>
[src]
Create a new sub font from the current font that by default inherits its parent font's face, scale, ppem and font funcs.
pub fn parent(&self) -> &Font<'a>
[src]
Returns the parent font.
pub fn face(&self) -> &Face<'a>
[src]
Returns the face which was used to create the font.
pub fn scale(&self) -> (i32, i32)
[src]
pub fn set_scale(&mut self, x: i32, y: i32)
[src]
pub fn ppem(&self) -> (u32, u32)
[src]
pub fn set_ppem(&mut self, x: u32, y: u32)
[src]
pub fn set_font_funcs<FuncsType>(&mut self, funcs: FuncsType) where
FuncsType: 'a + Send + Sync + FontFuncs,
[src]
FuncsType: 'a + Send + Sync + FontFuncs,
pub fn get_font_h_extents(&self) -> Option<FontExtents>
[src]
pub fn get_font_v_extents(&self) -> Option<FontExtents>
[src]
pub fn get_nominal_glyph(&self, c: char) -> Option<Glyph>
[src]
pub fn get_variation_glyph(&self, c: char, v: char) -> Option<Glyph>
[src]
pub fn get_glyph_h_advance(&self, glyph: Glyph) -> Position
[src]
pub fn get_glyph_v_advance(&self, glyph: Glyph) -> Position
[src]
pub fn get_glyph_h_origin(&self, glyph: Glyph) -> Option<(Position, Position)>
[src]
pub fn get_glyph_v_origin(&self, glyph: Glyph) -> Option<(Position, Position)>
[src]
pub fn get_glyph_h_kerning(&self, left: Glyph, right: Glyph) -> Position
[src]
pub fn get_glyph_v_kerning(&self, before: Glyph, after: Glyph) -> Position
[src]
pub fn get_glyph_extents(&self, glyph: Glyph) -> Option<GlyphExtents>
[src]
pub fn get_glyph_contour_point(
&self,
glyph: Glyph,
point_index: u32
) -> Option<(Position, Position)>
[src]
&self,
glyph: Glyph,
point_index: u32
) -> Option<(Position, Position)>
pub fn get_glyph_name(&self, glyph: Glyph) -> Option<String>
[src]
pub fn get_glyph_from_name(&self, name: &str) -> Option<Glyph>
[src]
Trait Implementations
impl<'a> Debug for Font<'a>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'a> HarfbuzzObject for Font<'a>
[src]
type Raw = hb_font_t
Type of the raw harfbuzz object.
unsafe fn reference(&self)
[src]
Increases the reference count of the HarfBuzz object. Read more
unsafe fn dereference(&self)
[src]
Decreases the reference count of the HarfBuzz object and destroys it if the reference count reaches zero. Read more
ⓘImportant traits for &'a mut Wunsafe fn from_raw<'a>(val: *const Self::Raw) -> &'a Self
[src]
Creates a reference from a harfbuzz object pointer. Read more
ⓘImportant traits for &'a mut Wunsafe fn from_raw_mut<'a>(val: *mut Self::Raw) -> &'a mut Self
[src]
Creates a mutable reference from a harfbuzz object pointer. Read more
fn as_raw(&self) -> *mut Self::Raw
[src]
Returns the underlying harfbuzz object pointer. Read more