Skip to main content

LayoutEngine

Struct LayoutEngine 

Source
pub struct LayoutEngine { /* private fields */ }
Expand description

Base layout engine. Combines all the information needed to shape a font for TeX.

Implementations§

Source§

impl LayoutEngine

Source

pub fn new( font: MaybeBorrow<'static, Font>, script: Tag, language: Option<Cow<'static, CStr>>, features: Box<[Feature]>, shaper_list: Vec<*const c_char>, rgb_value: u32, extend: f32, slant: f32, embolden: f32, ) -> LayoutEngine

Create a new layout engine from the needed information

Source

pub fn script(&self) -> Tag

Get the font script used

Source

pub fn extend(&self) -> f32

Get the extend

Source

pub fn slant(&self) -> f32

Get the slant

Source

pub fn embolden(&self) -> f32

Get the embolden

Source

pub fn rgb(&self) -> u32

Get the RGB

Source

pub fn font(&self) -> &Font

Get the font

Source

pub fn font_mut(&mut self) -> &mut Font

Get a mutable reference to the font

Source

pub fn default_dir(&self) -> u8

Get the default direction

Source

pub fn used_graphite(&self) -> bool

Check whether we’re using the graphite shaper

Source

pub fn used_ot(&self) -> bool

Check whether we’re using the OpenType shaper

Source

pub fn hb_buffer(&self) -> BufferRef<'_>

Get the harfbuzz buffer

Source

pub fn layout_chars(&mut self, chars: &[u16], rtl: bool) -> usize

Get the number of characters in the given slice

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.