ab-glyph
ab-glyph copied to clipboard
Setting font variations
Hello,
First of all, thanks for ab_glyph
and glyph_brush
; ab_glyph
is what's used to render glyphs in my acrylic
crate.
I was wondering how I could configure a font's variations?
I see that ttf-parser
has a Face::set_variation
method, is this method available from ab_glyph
?
I'd like to reference https://lorp.github.io/samsa/src/samsa-gui.html which is a great tool for playing with font variations.
Thank you very much.
Hello, currently ab_glyph hasn't exposed ttf-parser's variable font methods.
That should be doable, a couple of things come to mind after a quick look:
- Having a
&mut self
method in ab_glyph works less well withFontArc
so perhaps afn with_variation(self, ...)
move approach would work better. - The new methods would explicitly require ttf-parser feature "variable-font" so we should probably add that (so it works in no-std) or expose it in ab-glyph as a feature too.