Closed Bug 2088686 Opened 22 days ago Closed 9 days ago

Font variations on named variable font instances are not applied to OpenType layout for installed fonts on Linux

Categories

(Core :: Graphics: Text, defect)

Desktop
Linux
defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: khaled, Assigned: khaled)

Details

Attachments

(3 files, 1 external file)

Attached file Test HTML —

On desktop Linux, variations are applied to installed variable font named instance outlines but not to OpenType layout.

For example with Mada font installed locally, the marks keep default instance positioning even as the font weight increase. In the attached example, the font is loaded twice, one as a local font and once as a web font (from Google fonts). The mark positions only agree on the default (400) instance, all other named instances have the marks mispositioned in the local font.

Attached file Mada font file —

This seems because of https://searchfox.org/firefox-main/source/gfx/thebes/gfxFcPlatformFontList.cpp#489-492, the named instance index is masked off before calling hb_face_create_from_file_or_fail(), so HarfBuzz does not select the named instance. hb_face_create_from_file_or_fail() actually has a bug that prevents passing full index to it (https://github.com/harfbuzz/harfbuzz/issues/6567) which is probably why the high 16 bits were masked off here.

I think the easiest fix is hb_face_set_index() with the full index after the face is created, until HarfBuzz is fixed.

Attachment #9673773 - Attachment description: mada-named-instances.html → Test HTML

The harfbuzz issue was fixed in HarfBuzz 15.1.0.

Assignee: nobody → khaled
Status: NEW → ASSIGNED

There is an r+ patch which didn't land and no activity in this bug for 1 week.
:khaled, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.

Flags: needinfo?(khaled)
Flags: needinfo?(jfkthame)

I think this is waiting for someone to land it.

Flags: needinfo?(khaled)

(In reply to Khaled Hosny from comment #7)

I think this is waiting for someone to land it.

In progress; sorry for the delay.

Flags: needinfo?(jfkthame)
Pushed by jkew@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b914cdc2e52e https://hg.mozilla.org/integration/autoland/rev/2bb6db3b71df Pass FontConfig named-instance index to HarfBuzz. r=gfx-reviewers,jfkthame,bradwerth
Status: ASSIGNED → RESOLVED
Closed: 9 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: