Skip to content

Commit

Permalink
Add with_glyph_index function
Browse files Browse the repository at this point in the history
  • Loading branch information
fee1-dead committed Nov 14, 2021
1 parent 15a11ea commit cf37f0c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ impl GlyphId {
Self(c as u32 | C_BIT)
}

/// Creates a `GlyphId` representing a glyph index.
///
/// The index must not have the most significant bit set.
pub fn with_glyph_index(n: u32) -> Self {
assert!(n < CBIT);
Self(n)
}

/// Creates a `GlyphId` representing a placeholder value.
pub fn placeholder() -> Self {
Self(0)
Expand Down

0 comments on commit cf37f0c

Please sign in to comment.