pub struct InMemoryFontSystem { /* private fields */ }Expand description
Font system backed by an in process font map, for embedded and browser environments.
Implementations§
Source§impl InMemoryFontSystem
impl InMemoryFontSystem
Sourcepub fn with_fallback_shaping(self) -> Self
pub fn with_fallback_shaping(self) -> Self
Enable deterministic fallback shaping for tests and bootstrap, without a native shaping engine.
Sourcepub fn with_font(
self,
family: impl Into<String>,
bytes: impl Into<Vec<u8>>,
) -> Self
pub fn with_font( self, family: impl Into<String>, bytes: impl Into<Vec<u8>>, ) -> Self
Add a font by family name and return self.
Sourcepub fn insert(&mut self, family: impl Into<String>, bytes: impl Into<Vec<u8>>)
pub fn insert(&mut self, family: impl Into<String>, bytes: impl Into<Vec<u8>>)
Insert or replace a font.
Sourcepub fn with_font_data(self, font: FontData) -> Self
pub fn with_font_data(self, font: FontData) -> Self
Add a font the application already constructed, sharing its parsed faces, and return self.
Sourcepub fn insert_font_data(&mut self, font: FontData)
pub fn insert_font_data(&mut self, font: FontData)
Insert or replace an application owned font keyed by its canonical name; parses stay shared.
Trait Implementations§
Source§impl Clone for InMemoryFontSystem
impl Clone for InMemoryFontSystem
Source§impl Debug for InMemoryFontSystem
impl Debug for InMemoryFontSystem
Source§impl Default for InMemoryFontSystem
impl Default for InMemoryFontSystem
impl Eq for InMemoryFontSystem
Source§impl FontLoader for InMemoryFontSystem
impl FontLoader for InMemoryFontSystem
Source§impl FontSystem for InMemoryFontSystem
impl FontSystem for InMemoryFontSystem
Source§fn load_font(&self, query: &FontQuery) -> Result<FontData, FontError>
fn load_font(&self, query: &FontQuery) -> Result<FontData, FontError>
Load font data that matches the query.
Source§fn shape_text(
&self,
request: &ShapeRequest<'_>,
) -> Result<ShapedText, FontError>
fn shape_text( &self, request: &ShapeRequest<'_>, ) -> Result<ShapedText, FontError>
Shape text into positioned glyphs.
Source§impl PartialEq for InMemoryFontSystem
impl PartialEq for InMemoryFontSystem
impl StructuralPartialEq for InMemoryFontSystem
Source§impl TextShaper for InMemoryFontSystem
impl TextShaper for InMemoryFontSystem
Source§fn shape_text(
&self,
request: &ShapeRequest<'_>,
) -> Result<ShapedText, FontError>
fn shape_text( &self, request: &ShapeRequest<'_>, ) -> Result<ShapedText, FontError>
Shape text into positioned glyphs.
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryFontSystem
impl !UnwindSafe for InMemoryFontSystem
impl Freeze for InMemoryFontSystem
impl Send for InMemoryFontSystem
impl Sync for InMemoryFontSystem
impl Unpin for InMemoryFontSystem
impl UnsafeUnpin for InMemoryFontSystem
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