Skip to main content

FontAtlas

Struct FontAtlas 

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

Implementations§

Source§

impl FontAtlas

Source

pub fn new(inner: impl Atlas + 'static) -> FontAtlas

Source

pub fn get_glyph_id(&self, key: &str, style_bits: u16) -> Option<u16>

Source

pub fn get_base_glyph_id(&self, key: &str) -> Option<u16>

Source

pub fn cell_size(&self) -> (i32, i32)

Source

pub fn bind(&self, gl: &Context)

Source

pub fn underline(&self) -> LineDecoration

Source

pub fn strikethrough(&self) -> LineDecoration

Source

pub fn get_symbol(&self, glyph_id: u16) -> Option<CompactString>

Source

pub fn get_ascii_char(&self, glyph_id: u16) -> Option<char>

Source

pub fn glyph_tracker(&self) -> &GlyphTracker

Source

pub fn glyph_count(&self) -> u32

Source

pub fn recreate_texture(&mut self, gl: &Context) -> Result<(), Error>

Source

pub fn for_each_symbol(&self, f: &mut dyn FnMut(u16, &str))

Source

pub fn resolve_glyph_slot( &self, key: &str, style_bits: u16, ) -> Option<GlyphSlot>

Source

pub fn flush(&self, gl: &Context) -> Result<(), Error>

Source

pub fn delete(&self, gl: &Context)

Deletes the GPU texture resources associated with this atlas.

Source

pub fn update_pixel_ratio( &mut self, gl: &Context, pixel_ratio: f32, ) -> Result<f32, Error>

Updates the pixel ratio for HiDPI rendering.

Returns the effective pixel ratio to use for viewport scaling.

Source

pub fn cell_scale_for_dpr(&self, pixel_ratio: f32) -> f32

Returns the cell scale factor for layout calculations.

Source

pub fn texture_cell_size(&self) -> (i32, i32)

Returns the texture cell size in physical pixels.

Trait Implementations§

Source§

impl Debug for FontAtlas

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<A> From<A> for FontAtlas
where A: Atlas + 'static,

Source§

fn from(atlas: A) -> FontAtlas

Converts to this type from the input type.

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.