easy_imgui

Struct FontInfo

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

A font to be fed to the ImGui atlas.

Implementations§

Source§

impl FontInfo

Source

pub fn new(ttf: impl Into<Cow<'static, [u8]>>, size: f32) -> FontInfo

Creates a new FontInfo from a TTF content and a font size.

Source

pub fn default_font(size: f32) -> FontInfo

Creates a FontInfo using the embedded default Dear ImGui font, with the given font size.

The default size of the default font is 13.0.

Source

pub fn add_char_range(self, range: RangeInclusive<char>) -> Self

Adds the given char range to this font info.

If the range list is empty, it is as if '\u{20}'..='\u{ff}', that is the “ISO-8859-1” table. But if you call this function for a font, then it will not be added by default, you should add it yourself.

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.