Hi Felipe,
Thank you very much for keeping us posted.
Keep up the good work.
--Victor Westmann
2017-06-02 18:35 GMT-07:00 Felipe Sanches <juca@...2270...>:
Hi there,
These past days I've been adding an experimental UI to Inkscape for tweaking parameters in OpenType variable fonts. One major roadblock I stumbled upon is requiring me to think more carefully about some potentially deeper architectural changes. In the screenshot attached to this message you can see some text written with the Decovar variable font. The slider labeled "Testing" in the "Text & Font" dialog is wired to invoke a callback upon value-change. This callback detects the currently selected font based on the canvas text-tool cursor position, retrieves the corresponding font_instance object and invokes Freetype's FT_Set_Var_Design_Coordinates method with the updated design-space coordinates (the slider in this experiment is hardwired to adjust the weight axis of Decovar).
(I really miss a Freetype method to alter a single design-space coordinate, instead of having to pass the full array, by the way)
The way things work right now, unfortunately, leads to the glyphs not changing on-canvas because once they are loaded, they seem to be kept in a cache. As you can see in the screenshot, each glyph has a different weigth, based on the slider setting when the glyph was loaded for the first time. It seems quite obvious that I should do something to invalidate the cache upon dragging the slider. But that, on the other hand, should not alter glyphs in other places where the same variable font is being used in the same document.
Based on all that, I think that the proper implementation would involve creating individual font_instance objects for each text chunk where a variable-font is used with non-default design-space coordinates so that they can be tweaked independently. Achieving that, though, will surely involve a bit deeper fiddling with Inkscape's text internals, which is what I expect to do in my next few days of work on this.
cheers, Felipe Sanches
PS: I'm crossposting this to the Inkscape-devel mailing list as the rest of the development community may be interested in receiving updates on this topic. I may as well move all future updates to the Inkscape mailing list directly.
PS2: I heard that there's a GSoC student this year who's going to work on Inkscape's text implementation (fixing compliance issues to the SVG spec, I think...) It would be really great to keep in contact with him/her and the mentor to coordinate efforts.
2017-05-30 7:48 GMT-03:00 Khaled Hosny <khaledhosny@...3544...>:
On Tue, May 30, 2017 at 12:35:24AM -0300, Felipe Sanches wrote:
The relationship between pango and harfbuzz is still not very clear to
me,
as I have the impression that even pango_shape() invokes hb_shape()
under
the hood nowadays.
It will eventually call HarfBuzz on Linux, but in Windows and Mac it will call Uniscribe and Core Text, respectively. Switching to HarfBuzz on all platforms is kinda on Pango’s TODO list, but I don’t think anyone is working on it currently.
-- You received this message because you are subscribed to the Google Groups "Google Fonts Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to googlefonts-discuss+unsubscribe@...3168... To post to this group, send email to googlefonts-discuss@...820... . Visit this group at https://groups.google.com/group/googlefonts-discuss. To view this discussion on the web visit https://groups.google.com/d/ms gid/googlefonts-discuss/20170530104838.GC24994%40macbook. For more options, visit https://groups.google.com/d/optout.
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel