Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 2178389
Summary: | Qt application render very thin fonts after switch to VF version of Noto CJK fonts | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Qiyu Yan <yanqiyu01> | ||||||
Component: | qt5-qtbase | Assignee: | Than Ngo <than> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | unspecified | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 38 | CC: | awilliam, helio, i18n-bugs, jgrulich, jreznik, kde-sig, mfabian, pwu, rdieter, tagoh, than, travier | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | AcceptedFreezeException | ||||||||
Fixed In Version: | qt5-qtbase-5.15.8-7.fc38 | Doc Type: | If docs needed, set a value | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2023-03-23 00:16:30 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 2083913 | ||||||||
Attachments: |
|
Description
Qiyu Yan
2023-03-15 03:44:34 UTC
And just tested layering evince package, the non-flatpak evince get fonts rendered correctly and it select Nimbus fonts instead of all noto-cjk-vf fonts. So it should be flatpak only I guess? Oh wait. Does this only happens on ASCII/Latin characters? Can you provide any test document to try on Evince or screenshots? Created attachment 1950869 [details] Some text from Telegram A screenshot of CJK text in Telegram is in attachments and another English pdf can be found https://texdoc.org/serve/latexmk/0 I believe this problem in Evince have 2 ingredients, one is that when running in flatpak somehow it is always selecting noto for standard fonts, another is switching to VF make things even worse. Problem with Telegram can be something like bug in handling the fonts? (the bold text in the screenshot is a disaster) For Evince issue, that is actually a known issue and this is related to the change of google-noto-fonts. Please see some thread from here: https://github.com/fedora-silverblue/issue-tracker/issues/305#issuecomment-1442586241 Alright. I've tracked this down. I'd say this is a Qt bug actually. Let's see what happened there. When trying to open a Qt app, they request a font like this: FcConfigSubstitute editPattern has 7 elts (size 16) family: "Noto Sans CJK JP"(s) pixelsize: 13(f)(s) hintstyle: 1(i)(w) file: "/usr/share/fonts/google-noto-sans-cjk-vf-fonts/NotoSansCJK-VF.ttc"(s) index: 0(i)(s) lang: "ja"(w) prgname: "kwrite"(s) And We had Regular style in a font face at index 0 in TTC version of Noto CJK fonts though, in Variable font, Thin style is assigned to index 0. This means, in this case, earlier index has a priority if all the conditions are the same in the score. Given that the above request is really what Qt apps wants, they shouldn't matter what style of fonts it is. but actually not. The problem in Qt is that they assume that Regular should be available at first. Reassigning to Qt5. Created attachment 1951406 [details]
Proposed patch
The short description is that Qt5 doesn't support Variable fonts well. we need to igure it for workaround and accept named-instances only from variable fonts.
The long description is here:
Qt5 tries to gether font information through FcFontList() and register it into Qt's font database. and requesting a best font with FcFontMatch() against it. In fact, not requesting weight and width doesn't matter because it is actually linked to the font face and font index.
Let me explain a bit about variable fonts support in fontconfig. fontconfig has a special font pattern for variable fonts which has variable=true. this means "This is a variable font" and also contains some information which properties has "axis". applications can request some variations against it.
There are the miscalculation here. this pattern has index 0 and no values for properties which has "axis", because it will be figured out when the real axis is decided. thus, we don't have style for them. However, Qt are going to fill in blanks with default values. Thus, this pattern becomes Regular. Furthermore, Noto CJK fonts assigns Thin style to index 0 after updates. then, they dealt with Thin as Regular. that's it.
BTW apparently qt5-qtwayland seems linking qt5-qtbase statically. that really confused me a lot. applying this to qt5-qtbase doesn't get a fix on Wayland. we also need to rebuild qt5-qtwayland with this fixed qt5-qtbase.
Akira, could you please forward this to upstream? Thanks Let me propose this as a freeze exception. Akira, I don't know how long it will take for upstream to look at the bug. So I would include your patch as a temporary workaround in qt5-qtbase and build rpm for f38. What do you think about this approach? By the way, have you also tested the patch if it works? Thanks! That sounds good to me. and Yes, I tried that and confirmed the fix. please note that you also need to rebuild qt5-qtwayland with the fixed qt5-qtbase. otherwise the problem will still persists on Wayland. The test case is very easy. Once the fixed packages installed (also, making sure that you have google-noto-sans-cjk-vf-fonts installed), try to open a Qt app which has a font preference and find out one of "Noto Sans CJK JP/KR/SC/TC" and set a style to Regular and Thin. If the fix is properly applied, you'll see some changes on rendering. Discussed at 2023-03-20 blocker review meeting: https://meetbot-raw.fedoraproject.org/fedora-blocker-review/2023-03-20/f38-blocker-review.2023-03-20-16.00.html . This is accepted as a freeze exception issue as it looks pretty bad for CJK users, and will certainly affect live environments and first boot after install so it cannot be fully addressed by an update. FEDORA-2023-86d1102614 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-86d1102614 it would be great if someome of us can test and grant Karma! FEDORA-2023-86d1102614 has been pushed to the Fedora 38 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-86d1102614 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2023-86d1102614 has been pushed to the Fedora 38 stable repository. If problem still persists, please make note of it in this bug report. |