Bug 102645

Summary: FT_Set_Var_Design_Coordinates() does not affect previously rendered glyphs
Product: cairo Reporter: Khaled Hosny <dr.khaled.hosny>
Component: freetype font backendAssignee: Behdad Esfahbod <freedesktop>
Status: RESOLVED MOVED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: enhancement    
Priority: medium CC: freedesktop, mclasen
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Test program
Font used
Wrong output

Description Khaled Hosny 2017-09-10 15:51:56 UTC
Created attachment 134130 [details]
Test program

I’m trying to render variable fonts with Cairo and FreeType. If I call FT_Set_Var_Design_Coordinates() before rendering any glyphs things work as expected, but if a glyph is rendered with certain variable coordinates it will not be affected by FT_Set_Var_Design_Coordinates() and will be always rendered with the old coordinates.

Looks like the glyph cash does not take variable coordinates into account. The attached test program shows the issue; the second A should be rendered using the light not the heavy weight.
Comment 1 Khaled Hosny 2017-09-10 15:52:45 UTC
Created attachment 134131 [details]
Font used
Comment 2 Khaled Hosny 2017-09-10 15:53:16 UTC
Created attachment 134132 [details]
Wrong output
Comment 3 Behdad Esfahbod 2017-09-10 16:51:35 UTC
Correct.  Currently cairo doesn't know about variation coordinates.  Your best bet is to create a separate FT_Face every time you change variations.

Matthias Clasen and I are going to look into fixing this (and wiring up variations in Pango) next week.
Comment 4 Khaled Hosny 2017-09-10 17:17:21 UTC
Creating a new face seems to work indeed.
Comment 5 GitLab Migration User 2018-08-25 13:51:40 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/235.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.