FS#48550 - [fontconfig] Fontconfig confuses Demilight (350) with Regular (400)

Attached to Project: Arch Linux
Opened by Mingye Wang (arthur2e5) - Saturday, 12 March 2016, 19:10 GMT
Last edited by Andreas Radke (AndyRTR) - Monday, 28 March 2016, 14:40 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Jan de Groot (JGC)
Andreas Radke (AndyRTR)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Fontconfig <= 2.11.1 uses a segmented approach to map font weights. This breaks on fonts like Noto Sans CJK, where Demilight (OS/2 weight=350) and Regular (OS/2 weight=400) are both treated as Regular (fontconfig weight=80).

This bug is fixed upstream in Aug 2014 but is only available in developer snapshots. I have flagged this package previously, but I then realized I requested for a devel snapshot which doesn't sound good. (One can argue that fontconfig is somehow like wine now though).

The attachment contains rebased versions of upstream fixes (commits be6506c, bf9df5a, ffda7c0, 01bb697, 80edacc).

See https://bugs.freedesktop.org/show_bug.cgi?id=81453 for the upstream report.
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Monday, 28 March 2016, 14:40 GMT
Reason for closing:  Fixed
Comment by Andreas Radke (AndyRTR) - Sunday, 13 March 2016, 18:52 GMT
Fontconfig 2.11.94 is in testing repo. Please check it.
Comment by Zixing Liu (liushuyu) - Monday, 14 March 2016, 13:20 GMT
I tested fontconfig 2.11.94 and its output went like this:

[liushuyu@liushuyu ~]$ fc-match -V
fontconfig version 2.11.94
[liushuyu@liushuyu ~]$ fc-match -a 'Noto Sans CJK SC' | head
NotoSansCJK-Regular.ttc: "Noto Sans CJK SC" "Regular"
NotoSansCJK-Medium.ttc: "Noto Sans CJK SC" "Medium"
NotoSansCJK-DemiLight.ttc: "Noto Sans CJK SC" "DemiLight"
NotoSansCJK-Light.ttc: "Noto Sans CJK SC" "Light"
NotoSansCJK-Thin.ttc: "Noto Sans CJK SC" "Thin"
NotoSansCJK-Bold.ttc: "Noto Sans CJK SC" "Bold"
NotoSansCJK-Black.ttc: "Noto Sans CJK SC" "Black"
DejaVuSans.ttf: "DejaVu Sans" "Book"
DejaVuSansCondensed.ttf: "DejaVu Sans" "Condensed"
DejaVuSans-ExtraLight.ttf: "DejaVu Sans" "ExtraLight"
Comment by Mingye Wang (arthur2e5) - Monday, 14 March 2016, 13:30 GMT
Ah thanks liushuyu. This looks good.

I don't have Arch available on my system, but the results should be the same anyway (fc 2.11.1 with zero patches applied):

{{{
root [ ~ ] # fc-match -V
fontconfig version 2.11.1
root [ ~ ] # fc-match -a 'Noto Sans CJK SC' | head -n 2
NotoSansCJK-DemiLight.ttc: "Noto Sans CJK SC" "DemiLight"
NotoSansCJK-Regular.ttc: "Noto Sans CJK SC" "Regular"
}}}

As you can see, 2.11.1 mixed up. (How do you specify <pre> in Flyspray?)

2.11.94 yields the exactly same result (except for the shell PS1) as liushuyu's output, so I am not pasting it.
Comment by Mingye Wang (arthur2e5) - Wednesday, 16 March 2016, 21:05 GMT
Regarding the current testing package, fontconfig >= 2.11.91 should have https://cgit.freedesktop.org/fontconfig/commit/conf.d?id=b732bf057f4b3ec3bac539803005e9c42d056b2a applied upstream already, so 0002-Update-aliases-for-new-URW-fonts.patch is unnecessary. If you received a `patch' failure, that's because the changeset is already there.

Loading...