Struct allsorts::glyph_position::GlyphLayout
source · [−]pub struct GlyphLayout<'f, 'i, T>where
T: FontTableProvider,{ /* private fields */ }
Expand description
Used to calculate the position of shaped glyphs.
Implementations
sourceimpl<'f, 'i, T: FontTableProvider> GlyphLayout<'f, 'i, T>
impl<'f, 'i, T: FontTableProvider> GlyphLayout<'f, 'i, T>
sourcepub fn new(
font: &'f mut Font<T>,
infos: &'i [Info],
direction: TextDirection,
vertical: bool
) -> Self
pub fn new(
font: &'f mut Font<T>,
infos: &'i [Info],
direction: TextDirection,
vertical: bool
) -> Self
Construct a new GlyphLayout
instance.
Arguments
font
— the font that the glyphs belong to.infos
— the shaped glyphs to lay out.direction
— the horizontal text layout direction.vertical
—true
if the text is being laid out top to bottom.
sourcepub fn glyph_positions(&mut self) -> Result<Vec<GlyphPosition>, ParseError>
pub fn glyph_positions(&mut self) -> Result<Vec<GlyphPosition>, ParseError>
Retrieve the glyphs positions.
Auto Trait Implementations
impl<'f, 'i, T> !RefUnwindSafe for GlyphLayout<'f, 'i, T>
impl<'f, 'i, T> !Send for GlyphLayout<'f, 'i, T>
impl<'f, 'i, T> !Sync for GlyphLayout<'f, 'i, T>
impl<'f, 'i, T> Unpin for GlyphLayout<'f, 'i, T>
impl<'f, 'i, T> !UnwindSafe for GlyphLayout<'f, 'i, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more