Skip to main content

Fonts

Struct Fonts 

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

the fonts of a scene (or of anyone laying out text: the CPU path of G6e)

Implementations§

Source§

impl Fonts

Source

pub fn new() -> Fonts

Source

pub fn add(&mut self, data: &[u8], face: u32) -> Result<FontId>

a font from TrueType or OpenType bytes (face: the font of a collection, else 0)

Source

pub fn has(&self, f: FontId) -> bool

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn metrics(&self, f: FontId) -> Option<FontMetrics>

Source

pub fn glyph_of(&self, f: FontId, c: char) -> u32

the glyph for a character (0: the font lacks it)

Source

pub fn shape(&mut self, f: FontId, g: u32) -> Option<&GlyphShape>

a glyph’s contours in em units (y up) and what is known of them (cached)

Trait Implementations§

Source§

impl Default for Fonts

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Fonts

§

impl !UnwindSafe for Fonts

§

impl Forget for Fonts

§

impl Freeze for Fonts
where *const u8 is !null: Freeze, PhantomData<FontData>: Freeze,

§

impl Move for Fonts

§

impl Send for Fonts
where RawVecInner: Send, BoxRaw<TtFont>: Send, Arc<SharedFontRepr>: Send, Arc<VariedInstance>: Send, NodeRef<Owned, u32, GlyphShape, LeafOrInternal>: Send, BoxRaw<(u32, GlyphShape)>: Send,

§

impl Sync for Fonts
where RawVecInner: Sync, BoxRaw<TtFont>: Sync, Arc<SharedFontRepr>: Sync, Arc<VariedInstance>: Sync, NodeRef<Owned, u32, GlyphShape, LeafOrInternal>: Sync, BoxRaw<(u32, GlyphShape)>: Sync,

§

impl Unpin for Fonts
where *const u8 is !null: Unpin, Box<TtFont>: Unpin, Arc<SharedFontRepr>: Unpin, Arc<VariedInstance>: Unpin, *const LeafNode<u32, GlyphShape> is !null: Unpin, Box<(u32, GlyphShape)>: Unpin,

§

impl UnsafeUnpin for Fonts
where *const u8 is !null: UnsafeUnpin, PhantomData<FontData>: UnsafeUnpin,

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> ErasedDestructor for T
where T: 'static,

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 = !

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.