When Krita is set to use a CJK (Chinese, Japanese, Korean) locale, Qt fallbacks to use ancient Windows XP era font sets. These are bitmap, serif fonts. They requires certain letter size (12px) to be pixel exact, and do not work well with sub-pixel anti-aliasing, making them a poor choice for Krita. I will attach screenshots later to showcase what I mean. Since Windows 7, Microsoft ships a new series of UI font sets. They are: Latin default: Segoe UI Simplified Chinese: Microsoft YaHei UI Traditional Chinese: Microsoft JhengHei UI Japanese: Yu Gothic UI Korean: Malgun Gothic These are sans-serif, vector fonts. They scale nicely regardless of their size. I wonder if we can specify these fonts respectively to each CJK locale, or at least add them to qt's fallback font list.
Created attachment 132373 [details] Krita 4.4 CJK UI letter display under Windows 10 This is how Krita 4.4's CJK UI letters look under Windows 10 2004. The letters in on the Blending Mode droplist are difficult to read. They are not big enough to use anti-aliasing, while also not pixel-exact to their bitmap sizes, so they got crushed.
Created attachment 132374 [details] Krita 4.4 CJK UI letter display under Linux This is how Krita 4.4 CJK UI letters look under Linux. The anti-aliasing works properly, provided better readability.
Probably related: https://bugreports.qt.io/browse/QTBUG-58610 If Qt is not using Segoe UI on English language Windows, then this issue is not limited to CJK.
Created attachment 132380 [details] Krita UI with PMingLiU (Traditional Chinese) where even the smaller text is sharp To add to this, the CJK texts with pre-Vista fonts are usually quite readable as long as the font size used matches one of the bitmap sizes (which I think for MingLiU/PMingLiU includes at least 12px, 13px, 14px, 16px and 18px but I could be wrong), albeit having a dated appearance. It gets blurry only when the font size is too small (< 8pt). ... which comes to the question, does SimSun contain fewer bitmap sizes than MingLiU? Because my Traditional Chinese UI text is *sharp* (compare the names of the dockers).
Never mind, I just checked with FontForge. MingLiU/PMingLiU contains bitmaps for 11, 12, 13, 15, 16 and 20px, but SimSun only contains bitmaps for 12 to 17px. This explains the difference.
Yes, that looks like a relevant Qt bug report. Looks like this will only be fixed for Qt6. Question is... Should we override the default fonts in Krita, patch our Qt or wait and do nothing?
I think for now, I'll add a config option. I don't want to mess around patching Qt's font database...
Git commit 0bad1b9b0bf3d7e0f6269956ad381bbd2b6e1431 by Boudewijn Rempt. Committed on 16/10/2020 at 14:25. Pushed by rempt into branch 'master'. Add a UI font selection option Qt doesn't select the modern, nice user interface fonts on Windows, so give the user a chance to select those themselves. And once that's there, why not let everyone select that font. M +1 -0 libs/ui/KisApplication.cpp M +11 -0 libs/ui/KisMainWindow.cpp M +28 -0 libs/ui/dialogs/kis_dlg_preferences.cc M +182 -132 libs/ui/forms/wdggeneralsettings.ui M +2 -2 libs/widgets/KoToolBoxButton.cpp M +1 -0 libs/widgetutils/CMakeLists.txt R +19 -7 libs/widgetutils/kis_font_family_combo_box.cpp [from: plugins/tools/svgtexttool/kis_font_family_combo_box.cpp - 094% similarity] R +9 -5 libs/widgetutils/kis_font_family_combo_box.h [from: plugins/tools/svgtexttool/kis_font_family_combo_box.h - 090% similarity] M +0 -1 plugins/tools/svgtexttool/CMakeLists.txt https://invent.kde.org/graphics/krita/commit/0bad1b9b0bf3d7e0f6269956ad381bbd2b6e1431
Thank you Boud and Alvin! Now we can have better looking texts under Windows! :D
Git commit 40616316f0e36cfa6cfb026158400a1b7b1f09eb by Boudewijn Rempt. Committed on 20/10/2020 at 09:12. Pushed by rempt into branch 'krita/4.3'. Add a UI font selection option Qt doesn't select the modern, nice user interface fonts on Windows, so give the user a chance to select those themselves. And once that's there, why not let everyone select that font. (cherry picked from commit 0bad1b9b0bf3d7e0f6269956ad381bbd2b6e1431) M +1 -0 libs/ui/KisApplication.cpp M +11 -0 libs/ui/KisMainWindow.cpp M +28 -0 libs/ui/dialogs/kis_dlg_preferences.cc M +186 -66 libs/ui/forms/wdggeneralsettings.ui M +2 -2 libs/widgets/KoToolBoxButton.cpp M +1 -0 libs/widgetutils/CMakeLists.txt R +19 -7 libs/widgetutils/kis_font_family_combo_box.cpp [from: plugins/tools/svgtexttool/kis_font_family_combo_box.cpp - 094% similarity] R +9 -5 libs/widgetutils/kis_font_family_combo_box.h [from: plugins/tools/svgtexttool/kis_font_family_combo_box.h - 090% similarity] M +0 -1 plugins/tools/svgtexttool/CMakeLists.txt https://invent.kde.org/graphics/krita/commit/40616316f0e36cfa6cfb026158400a1b7b1f09eb
Git commit 40c1cd91f30ae8dbb3febf244b1dc721762e07bd by Alvin Wong. Committed on 22/06/2021 at 09:50. Pushed by alvinwong into branch 'master'. win: Use new modern system font as default Use the new system font introduced since Windows Vista, which is Segoe UI on English locale, MS JhengHei on Trad. Chinese, MS YaHei on Simp. Chinese, Meiryo on Japanese, etc. The code is referenced from Qt. See also: https://bugreports.qt.io/browse/QTBUG-58610 M +94 -0 libs/ui/KisUiFont.cpp https://invent.kde.org/graphics/krita/commit/40c1cd91f30ae8dbb3febf244b1dc721762e07bd
Thank you Alvin! :D
Now that Krita's CJK fonts has been renewed, I wonder if we can somehow do the same for other KDE apps under Windows, without changing each app individually? The same problem happens to Krita, digiKam, Kdenlive, Kate Editor, etc.
I cannot decide for other applications whether they would want to apply this change now. From what I understand the new default font is used in Qt 6. It is possible to patch Qt 5 to enable the new default fonts, but I don't know how the other applications share the Qt builds, so I can't answer this question.
Thank you for the explanation. If Qt6 is going to use them, I suppose we can just wait for it. Maybe I can let digiKam, Kdenlive and Kate teams know about this. For those apps are popular and text heavy.
This also fixed half of the issues we discussed in Bug 432882. (For some reason when I was reporting Bug 432882, I wasn't able to find Bug 427733 by searching the keyword "font"...they are sort of duplicate now but now really, sorry about that)