On Tue, 2018-03-06 at 13:19 -0300, Felipe Sanches wrote:
I left this aside for the past 6 months and recently got back to looking at it.
I think the most trivial thing would be to populate the font-styles combo-box with named instances. This would be almost not perceptible by the users, but would enable variable fonts' instances to show up there just like their non-variable counterparts do.
That would be good if that information can be extracted from the font. Speaking of which, I wonder if the OpenType 'fvar' table can be easily extracted (which contains the ranges for the axes).
Then there's the customization aspect of varfonts. For that, I think the bare minimum would be a bunch of sliders for selecting the coordinates of each variation axis. I feel that there must be something better than that form a user experience perspective, but I'm still not sure what would that be, so I'd leave it for a second iteration of the UI.
Sounds good. The sliders would then fill in the 'font-variation- settings' property:
https://www.w3.org/TR/css-fonts-4/#font-variation-settings-def
Also, since one can get a multitude of combinations within the designspace, I think it could be practical to adopt a UI workflow similar to that of color gradients, in which once a user-defined instance is applied to a text chunk, that instance is added to a pool of var font instances that can be reused in other chunks of texto within the document. A shared varfont would then, upon tweaking of its design space coordiantes, affect all portions of the document where it was used.
This would probably require a pop-up dialog to edit (or duplicate) an entry in the font-style drop-down menu. We'll need to set up signals so that all text/tspan elements are updated whenever an entry is modified.
Finally, and this is not a varfont specific issue, I feel the urge to improve the basic text support in Inkscape in general. Yes, I know this is a somewhat vague statement. The overall direction I'd like to follow, though, would likely be something similar to the insightful ideas that are expressed in this article:
This might be something for GTK as more than just Inkscape could use such a dialog. GTK 3 does have a font-family dialog that we do not use at the moment:
https://developer.gnome.org/gtk3/stable/GtkFontChooserDialog.html
https://medium.com/@getflourish/the-anatomy-of-a-thousand-typefaces- f7b9088eed1
Tav
cheers, Felipe Sanches