Crate glyph_names

source ·
Expand description

Map a character to a glyph name according to the Adobe Glyph List Specification.


use std::borrow::Cow;
use glyph_names::glyph_name;

assert_eq!(glyph_name('a' as u32), Some(Cow::from("a")));
assert_eq!(glyph_name('%' as u32), Some(Cow::from("percent")));
assert_eq!(glyph_name('☺' as u32), Some(Cow::from("smileface")));
assert_eq!(glyph_name('↣' as u32), Some(Cow::from("uni21A3")));
assert_eq!(glyph_name('🕴' as u32), Some(Cow::from("u1F574")));
assert_eq!(glyph_name(0x110000), None);


A slice containing all glyph names.


Look up a glyph name for the supplied char code.