Skip to main content

BitmapSource

Struct BitmapSource 

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

The built-in five-by-seven font at whole-number scales.

Implementations§

Source§

impl BitmapSource

Source

pub fn new() -> Self

Wraps the built-in font.

Trait Implementations§

Source§

impl Debug for BitmapSource

Source§

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

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

impl Default for BitmapSource

Source§

fn default() -> Self

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

impl GlyphSource for BitmapSource

Source§

fn name(&self) -> &str

Human-readable name, for logging which font a panel actually loaded.
Source§

fn metrics(&self, size_px: u16) -> FontMetrics

Vertical metrics at size_px.
Source§

fn glyph_id(&self, ch: char) -> Option<GlyphId>

The glyph a character maps to, or None if this source has none. Read more
Source§

fn glyph_metrics( &mut self, glyph: GlyphId, size_px: u16, ) -> Option<GlyphMetrics>

Metrics for one glyph, without rasterising it. Read more
Source§

fn rasterise(&mut self, glyph: GlyphId, size_px: u16) -> Option<Rasterised<'_>>

Rasterises one glyph. Read more
Source§

fn contains(&self, ch: char) -> bool

Returns true if this source has a glyph of its own for ch, as opposed to a fallback box.
Source§

fn fallback_id(&self, ch: char) -> Option<GlyphId>

The glyph to draw for a character this source does not have. Read more
Source§

fn snap_size(&self, size_px: u16) -> u16

Sizes this source can actually produce, or None if it is continuous. Read more
Source§

fn shape(&mut self, text: &str, size_px: u16, out: &mut Vec<ShapedGlyph>) -> i32

Turns a string into positioned glyphs, appended to out. Read more
Source§

fn can_shape(&self) -> bool

Returns true if this source lays out runs itself through shape, rather than one glyph per character. Read more

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

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.