Skip to content

Commit

Permalink
PxTypeface::contains
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldom-SE committed Jan 19, 2025
1 parent 39e493c commit 1d00147
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ pub struct PxTypeface {
pub(crate) max_frame_count: usize,
}

impl PxTypeface {
/// Check whether the typeface contains the given character, including separators
pub fn contains(&self, character: char) -> bool {
self.characters.contains_key(&character) || self.separators.contains_key(&character)
}
}

impl RenderAsset for PxTypeface {
type SourceAsset = Self;
type Param = ();
Expand Down

0 comments on commit 1d00147

Please sign in to comment.