Skip to main content

AtlasChars

Struct AtlasChars 

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

The characters an atlas keeps, of those its font has: every one of ATLAS_RANGES, every character the game’s text uses, and the glyphs the project requires; never a combining mark or a control character. Its wide sets keep the characters of the languages that draw from them (wants_wide). AtlasChars::default is the ranges alone.

Implementations§

Source§

impl AtlasChars

Source

pub fn of_lang(lang: &Lang, required: &str) -> Self

The ranges, every character of lang’s text (Lang::texts) and the glyphs of required.

Source

pub fn with_wide(self, wide: &str) -> Self

The same characters, and the glyphs of wide kept from the unnamed wide font whatever the text uses (a name entry’s letters).

Source

pub fn with_wide_set(self, set: Option<&str>, wide: &str) -> Self

The same characters, and the glyphs of wide kept from the wide font of set set (None: the unnamed one) whatever the text uses.

Source

pub fn wants_wide( &self, c: char, narrow: &BitmapFont, set: Option<&str>, ) -> bool

Whether the atlas keeps c in the wide set set (None: the unnamed one), if its font has it: a character the text of the languages drawing from that set uses, or one of the project’s wide glyphs for it, that the narrow fonts (narrow) don’t have; or punctuation those languages have wide.

Source

pub fn wants(&self, c: char) -> bool

Whether the atlas keeps c, if its font has it.

Source

pub fn used(&self) -> &BTreeSet<char>

The characters the text uses, without control characters and combining marks.

Trait Implementations§

Source§

impl Clone for AtlasChars

Source§

fn clone(&self) -> AtlasChars

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AtlasChars

Source§

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

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

impl Default for AtlasChars

Source§

fn default() -> AtlasChars

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

impl Eq for AtlasChars

Source§

impl PartialEq for AtlasChars

Source§

fn eq(&self, other: &AtlasChars) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AtlasChars

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.