alexheretic / ab-glyph

Rust API for loading, scaling, positioning and rasterizing OpenType font glyphs
Apache License 2.0
372 stars 24 forks source link

provide alternative to Font::glyph_id for specifying glyphs for whom no char exists #44

Closed neadeer closed 3 years ago

neadeer commented 3 years ago

i would like to use ab-glyph with a font-shaping library, like harfbuzz.

ab-glyph is great for writing-systems with nice char->glyph mappings, but many writing systems have glyphs that are effected by the surrounding text or glyphs that are composed of multiple char.

if there was some way of feeding a glyph id as an integer value, i could ask my font-shaping library what glyph i need, and ab-glyph could render it for me.

alexheretic commented 3 years ago

If you know the integer id you don't need to call Font::glyph_id, you can construct directly

GlyphId(123).with_scale(48.0)
neadeer commented 3 years ago

thanks!