Skip to main content

TextEngine

Struct TextEngine 

Source
pub struct TextEngine { /* private fields */ }

Implementations§

Source§

impl TextEngine

Source

pub fn set_fallbacks( &mut self, primary: &str, weight: Option<u16>, faces: &[Fallback], ) -> Result<(), Error>

Source

pub fn families(&self) -> Vec<String>

Source

pub fn face_metrics(&mut self, family: &str, weight: u16) -> Option<FaceMetrics>

Source

pub fn picks(&mut self, span: &Span) -> Vec<Pick>

Source§

impl TextEngine

Source

pub fn place_number( &mut self, span: &Span, chars: &str, anchor: Anchor, placement: &Placement, ) -> Result<Placed, Error>

Source

pub fn place_number_with( &mut self, span: &Span, chars: &str, forms: NumberForms, anchor: Anchor, placement: &Placement, ) -> Result<Placed, Error>

Source

pub fn cached_number_faces(&self) -> usize

Source

pub fn ligating_pairs( &mut self, face: &Face, chars: &str, forms: NumberForms, scale: f32, ) -> Result<Vec<(char, char)>, Error>

Source§

impl TextEngine

Source

pub fn prefill(&mut self, list: &[Prefill]) -> Result<usize, Error>

Source

pub fn prefill_on( &mut self, list: &[Prefill], threads: usize, ) -> Result<usize, Error>

Source§

impl TextEngine

Source

pub fn print_spans( &mut self, image: &mut PrintImage, block: &PrintBlock<'_>, ) -> Result<Printed, Error>

Source§

impl TextEngine

Source

pub fn new(font_bytes: &[u8]) -> Result<Self, Error>

Source

pub fn register_font(&mut self, font_bytes: &[u8]) -> Result<(), Error>

Source

pub fn begin_frame(&mut self)

Source

pub fn end_frame(&mut self)

Source

pub fn set_shaping_budget(&mut self, bytes: u64)

Source

pub fn shaping_stats(&self) -> ShapingStats

Source

pub fn cached_atlases(&self) -> usize

Source

pub fn set_atlas_budget(&mut self, bytes: u64)

Source

pub fn set_atlas_page(&mut self, size: u32) -> Result<(), Error>

Source

pub fn atlas_stats(&self) -> AtlasStats

Source

pub fn take_atlas_changes(&mut self) -> AtlasChanges

Source

pub fn atlas_page(&self, id: u32) -> Option<&Atlas>

Source

pub fn cached_blocks(&self) -> usize

Source

pub fn cached_rasters(&self) -> usize

Source

pub fn layout_spans( &mut self, spans: &[Span], width: Option<f32>, scale: f32, anchor: Anchor, ) -> Result<&Block, Error>

Source

pub fn render_spans( &mut self, spans: &[Span], width: Option<f32>, scale: f32, anchor: Anchor, representation: Representation, origin: [f32; 2], alpha: f32, clip: [f32; 4], turn: [f32; 3], ) -> Result<RichParagraph, Error>

Source

pub fn place_spans( &mut self, spans: &[Span], width: Option<f32>, anchor: Anchor, placement: &Placement, ) -> Result<Placed, Error>

Source

pub fn layout( &mut self, text: &str, style: Style<'_>, baseline: &Baseline, ) -> Result<Paragraph, Error>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.