Skip to content

Commit

Permalink
feat: add font face name getter. (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
AcrylicShrimp authored Jun 10, 2024
1 parent 92a9759 commit 6d868b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,12 @@ impl Font {
})
}

/// Returns the font's face name if it has one. It is from `Name ID 4` (Full Name) in the name table.
/// See https://learn.microsoft.com/en-us/typography/opentype/spec/name#name-ids for more info.
pub fn name(&self) -> Option<&str> {
self.name.as_deref()
}

/// Returns all valid unicode codepoints that have mappings to glyph geometry in the font, along
/// with their associated index. This does not include grapheme cluster mappings. The mapped
/// NonZeroU16 index can be used in the _indexed font functions.
Expand Down

0 comments on commit 6d868b8

Please sign in to comment.