Italic font used for regular text with Goudy Old Style under Linux

RESOLVED INVALID

Status

()

Core
Graphics: Text
RESOLVED INVALID
3 years ago
3 years ago

People

(Reporter: heftig, Unassigned)

Tracking

44 Branch
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [gfx-noted])

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Visited http://aiohttp.readthedocs.org/en/stable/client.html using Firefox 44.0a2.

The "Goudy Old Style" font, sourced from Windows 7, is available.

The italic variant of Goudy Old Style is chosen for the text. The regular variant should have been chosen.

Disabling `gfx.font_rendering.fontconfig.fontlist.enabled` restores the expected behavior.


Goudy Old Style v1.51 md5sums:
856dd110b08628f38f8fcfafe6fab19c  GOUDOSB.TTF
832e3cfb4368f895ac5805cb9fff7898  GOUDOSI.TTF
78d7bdc55148aaa3307a1e8ad735c40f  GOUDOS.TTF
(In reply to Jan Steffens from comment #0)
> Visited http://aiohttp.readthedocs.org/en/stable/client.html using Firefox
> 44.0a2.
> 
> The "Goudy Old Style" font, sourced from Windows 7, is available.

FWIW, I don't see a "Goudy Old Style" in the list at https://www.microsoft.com/typography/Fonts/product.aspx?PID=161. I suspect it may have come from some other package.
Blocks: 1180560
(Reporter)

Comment 2

3 years ago
Right; it must have come from MS Office: https://www.microsoft.com/typography/fonts/font.aspx?FMID=981
Is this a recent regression?
Whiteboard: [gfx-noted]
It must be fairly recent, as the new Linux font-list code initially landed for mozilla-41, I believe (bug 1056479, mozilla-41; there have also been a number of followups, some of which may have affected this). Note that comment 0 indicates that the old code (i.e. with the new font-list preffed off) doesn't have this problem.

Updated

3 years ago
Summary: Mistakenly chooses italic font variant → Italic font used for regular text with Goudy Old Style under Linux

Comment 5

3 years ago
I've reproduced the problem using versions of these fonts from an old Windows XP install.

The problem here is that the Goudy Old Style family from Windows XP has some odd width values in the OS/2 table [1]:

GOUDOS.ttx:    <usWidthClass value="6"/>
GOUDOSB.ttx:    <usWidthClass value="6"/>
GOUDOSI.ttx:    <usWidthClass value="5"/>

This implies that the regular and bold faces have a semi-expanded width while the italic face has a normal width. By the style matching rules defined in CSS3 Fonts, matching the italic face is correct for plain text because matching font-stretch: normal takes precedence over matching font-style: normal.

[1] https://www.microsoft.com/typography/otspec/os2.htm#wdc

The older font matching code was deferring to fontconfig which implements it's own set of priorities for font matching.
Blocks: 543715
No longer blocks: 1180560
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INVALID
(Reporter)

Comment 6

3 years ago
Created attachment 8698297 [details]
fontconfig to fix up widths

Here's a fontconfig file that fixes the reported width. Force-regenerating the caches (fc-cache -f) will be needed to fix existing fonts.
You need to log in before you can comment on or make changes to this bug.