Closed Bug 1424648 Opened 3 years ago Closed 3 years ago

Helvetica Bold drawn with non-bold glyphs

Categories

(Core :: Graphics: WebRender, defect, P2)

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: heftig, Assigned: heftig)

References

(Blocks 1 open bug)

Details

(Whiteboard: [wr-mvp] [triage])

Attachments

(1 file, 1 obsolete file)

Setup:
Nightly on Arch Linux
WebRender enabled
Helvetica.ttc sourced from MacOS High Sierra

Helvetica Bold is drawn using metrics from the bold variant but with glyphs from the normal variant. Perhaps a glyph caching issue?

Non-WebRender is fine.
Whiteboard: [wr-mvp] [triage]
Linux only?
Priority: -- → P2
I can only test Linux, I'm afraid.
There's a related problem where Helvetica Light picks the wrong glyphs and the string "abcdefgh" is drawn as "_`abcdef" with the Regular outlines but the correct metrics. E.g. the "f" has the Regular "d" outline but the Light "f" metrics.

I think WebRender might be losing the face index needed to go with the font file somewhere.

FontHandleMethods::new_from_template (servo/components/gfx/platform/freetype/font.rs) looks like it loads font data from a FontTemplateData, which holds a read font file, but the FontTemplateData only uses the pathname as its identifier and create_face_from_buffer always uses 0 as the face index.
for_each_variation (servo/components/gfx/platform/freetype/font_list.rs) also drops the font index on the floor.
Attached patch fix-ttc.diff (obsolete) — Splinter Review
The attached patch seems to fix things and renders all 6 of Helvetica's styles properly. That said I was flying blind and don't even know what (WR)FontDescriptorOutput is for.

Perhaps some clarification before I can pack this up in a reviewable patch with a proper message?
Assignee: nobody → jan.steffens
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #8947201 - Attachment is obsolete: true
Comment on attachment 8947221 [details]
Bug 1424648 - Provide proper face index to FreeType FontDescriptorOutput;

https://reviewboard.mozilla.org/r/216978/#review222830
Attachment #8947221 - Flags: review?(lsalzman) → review+
Keywords: checkin-needed
Pushed by cbrindusan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b8ad646de7a7
Provide proper face index to FreeType FontDescriptorOutput; r=lsalzman
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/b8ad646de7a7
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.