Bug 102645 - FT_Set_Var_Design_Coordinates() does not affect previously rendered glyphs
Summary: FT_Set_Var_Design_Coordinates() does not affect previously rendered glyphs
Status: RESOLVED MOVED
Alias: None
Product: cairo
Classification: Unclassified
Component: freetype font backend (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: Behdad Esfahbod
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-10 15:51 UTC by Khaled Hosny
Modified: 2018-08-25 13:51 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Test program (1.07 KB, text/x-csrc)
2017-09-10 15:51 UTC, Khaled Hosny
Details
Font used (124.78 KB, application/x-font-ttf)
2017-09-10 15:52 UTC, Khaled Hosny
Details
Wrong output (4.10 KB, image/png)
2017-09-10 15:53 UTC, Khaled Hosny
Details

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.