https://bugs.winehq.org/show_bug.cgi?id=50252
Bug ID: 50252 Summary: (linked ?) fonts not handled correctly since wine 5.21 Product: Wine Version: 5.21 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdi32 Assignee: wine-bugs@winehq.org Reporter: galtgendo@o2.pl Distribution: ---
Created attachment 68771 --> https://bugs.winehq.org/attachment.cgi?id=68771 WINEDEBUG=font console output
The problem was noticed first in an installer, but it's visible even in regedit, but there only with menu font.
Currently on 6.0-rc1.
When regedit is run in LANG=ja_JP.utf8 locale (which is not my primary one - may or may not matter), menubar and menus are full of missing glyph boxes (except for the bits consisting of latin letters).
The patch that I've sent to the list only consistently worked for 5.21, not later. There also may be some randomness involved (maybe due to fontconfig cache), as in some cases menus did show up correctly in 5.22 with that old patch, but (for the time being) seems to be consistently broken in 6.0-rc1.
https://bugs.winehq.org/show_bug.cgi?id=50252
--- Comment #1 from Alexandre Julliard julliard@winehq.org --- I don't see any difference in behavior. Please explain how to reproduce the regression.
https://bugs.winehq.org/show_bug.cgi?id=50252
--- Comment #2 from Rafał Mużyło galtgendo@o2.pl --- (In reply to Alexandre Julliard from comment #1)
I don't see any difference in behavior. Please explain how to reproduce the regression.
Well, the additional element might be bug 42606, but I've yet to hear about a better solution there, as that theme setting can't be volatile, like some of the other locale dependent settings are, yet the current way caches charset across locales, which is - as the bug explains - broken.
Other than that, it's all standard - just font replacement keys set up between respective IPA Mona and MS Mincho/Gothic families.
(if the log doesn't make it clear, besides bug 42606 adjustment, MenuFont is still standard Tahoma)
(PS: to make it clear: my primary locale is pl_PL.utf8, bug 42606 happens once the secondary one (ja_JP.utf8) is used; this bug also happens in the secondary locale, as in primary, wine's Tahoma has the sufficient coverage - so if you were trying to reproduce in a prefix that was set up for ja_JP.utf8 as as *primary* locale, if bug 42606 actually *does* play a role, chances are things appeared to work fine)
(the other, non-menu font used in regedit looks fine; as it seems to be a linked font too ("MS Shell Dlg", going by regedit.rc), this might suggest that the issue here might be not the changes in handling linked fonts, but those in font caching...perhaps DEFAULT_CHARSET confuses font comparison helpers and instead of DEFAULT_CHARSET, it should always explicitly translated to the charset bound to ACP ?)
https://bugs.winehq.org/show_bug.cgi?id=50252
--- Comment #3 from Alexandre Julliard julliard@winehq.org --- I still don't see any difference. Please explain how to reproduce it in unpatched Wine, showing exact commands and environment variables, starting with an empty prefix.
https://bugs.winehq.org/show_bug.cgi?id=50252
--- Comment #4 from Rafał Mużyło galtgendo@o2.pl --- (In reply to Alexandre Julliard from comment #3)
I still don't see any difference. Please explain how to reproduce it in unpatched Wine, showing exact commands and environment variables, starting with an empty prefix.
So, I'll need to recheck my patch from bug 42606, but other than that, it's straightforward:
- 'wine regedit' (meaning default pl_PL.utf8 locale): everything looks correct - 'LANG=ja_JP.utf8 wine regedit' : non-latin glyphs in menubar/menus are just missing glyph boxes
As an additional point, if I set the name of MenuFont in the relevant WindowMetrics key to empty (well, starting with L'\0', to be exact), a different font gets matched and menubar/menus are correctly displayed.
So, it's more likely it's about caching changes, yet I suspect something like this could be reproduced in unpatched wine, just not as easily - you'd likely need a situation where a logfont with DEFAULT_CHARSET gets expanded to different fonts depending on current locale (base_font being a linked font might play a role).
https://bugs.winehq.org/show_bug.cgi?id=50252
--- Comment #5 from Rafał Mużyło galtgendo@o2.pl --- Created attachment 68823 --> https://bugs.winehq.org/attachment.cgi?id=68823 needed cjk font mappings
https://bugs.winehq.org/show_bug.cgi?id=50252
--- Comment #6 from Rafał Mużyło galtgendo@o2.pl --- Created attachment 68837 --> https://bugs.winehq.org/attachment.cgi?id=68837 how it looks like with Tahoma as MenuFont
https://bugs.winehq.org/show_bug.cgi?id=50252
--- Comment #7 from Rafał Mużyło galtgendo@o2.pl --- Created attachment 68838 --> https://bugs.winehq.org/attachment.cgi?id=68838 how it looks like when font name is cleared
https://bugs.winehq.org/show_bug.cgi?id=50252
--- Comment #8 from Rafał Mużyło galtgendo@o2.pl --- Trying to figure out a reason behind those changes, I've downloaded AMP Font Viewer (available at http://www.ampsoft.net/utilities/FontViewer.php).
Got some odd results.
For one, unrelated to this problem, that program doesn't display Webdings correctly - all glyphs are clipped at the bottom.
But the interesting thing happens when I try Tahoma. Adding a couple kanji to the example text: - if I try to do it in pl_PL.utf8 locale, surprisingly, Tahoma acts like a proper linked font and finds those glyphs somewhere - if I do it under ja_JP.utf8, I get missing font boxes
(if I select font that does have those glyphs, they're shown properly regardless of locale)
https://bugs.winehq.org/show_bug.cgi?id=50252
--- Comment #9 from Rafał Mużyło galtgendo@o2.pl --- ...so, it would seem that my initial problem in this bug wasn't quite a regression - it was more of a minor user error mixed with wine's behavior change.
As you may see in that registry file, for historical reasons I had both HKLM\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes and HKCU\Software\Wine\Fonts\Replacements set up with mapping IPA Mona families to respective MS families. In my defense, all those years back when I've set it up, I couldn't find any proper documentation for this and for most cases just having FontSubstitutes worked. That was actually the only set of keys that I've had set up initially and it worked in most cases. Far more recently (IIRC, within last year) I've noticed that one of the cases that didn't, started to work with Replacements. But things continued to work with both of those set.
It would seem this ended with wine 5.21.
After removing relevant FontSubstitutes keys, regedit no longer has this problem with missing glyphs.
Tahoma also seems to act properly in the Font Viewer.
But (as that had been unrelated problem) Webdings are still clipped. (also that program seems to handle DejaVu Math TeX Gyre oddly, but that might just be a bug in the program - after all, that a somewhat specialized font, so I wouldn't be surprised if it had slightly odd metrics)
https://bugs.winehq.org/show_bug.cgi?id=50252
Mokou mokouthrowaway@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mokouthrowaway@gmail.com
--- Comment #10 from Mokou mokouthrowaway@gmail.com --- Created attachment 68902 --> https://bugs.winehq.org/attachment.cgi?id=68902 Japanese text rendering in notepad on wine 5.0 and 6.0-rc1
I can reproduce a very similar issue in a clean wineprefix with LANG=ja_JP.UTF-8, no other locale-related environment variables set. Steps to reproduce:
1. Open notepad 2. Paste "見本です" 3. Check if Japanese characters render correctly
I managed to reproduce this with LC_ALL=en_US.UTF-8 too so it might not be locale-related.
The offending commit appears to be: commit 044315c0b3890676d9fd751d8191b0b7381e0b97 (HEAD, refs/bisect/bad) Author: Alexandre Julliard julliard@winehq.org Date: Thu Oct 29 14:47:18 2020 +0100
gdi32: Move the glyph index mapping for GetGlyphOutline() out of freetype.c.
Signed-off-by: Alexandre Julliard julliard@winehq.org
Japanese text rendering works fine on 044315c0b~1 but breaks on 044315c0b and later.
308a0cf72d884f2b716b6df6954ef55e572b07cc managed to fix some related problems (there was a similar issue with the font sample in winecfg), but the issue described above can still be reproduced on wine-6.0-rc1 and wine-6.0-rc2 (current master).
https://bugs.winehq.org/show_bug.cgi?id=50252
--- Comment #11 from Rafał Mużyło galtgendo@o2.pl --- (In reply to Mokou from comment #10)
That seems unrelated. I mean if the font in notepad is set to System, no Japanese glyphs are printed, but if it's Tahoma, glyphs are drawn correctly for me.
Unless you don't have the registry overrides set up for your font (I haven't tested such case) and what you're saying is that it worked without the overrides before...
(we might be diving into unintended yet beneficial *side effects* of the previous code and/or details of our respective font setups)
https://bugs.winehq.org/show_bug.cgi?id=50252
--- Comment #12 from Mokou mokouthrowaway@gmail.com --- (In reply to Rafał Mużyło from comment #11)
Unless you don't have the registry overrides set up for your font (I haven't tested such case) and what you're saying is that it worked without the overrides before...
That's what I'm saying, I have tested this in a clean prefix without any additional font overrides on unpatched Wine. It occurs in some other software too but notepad is the easiest to reproduce as it's distributed with Wine. I wasn't sure if it was worth reporting separately, the symptoms looked similar enough and it seemed to be connected to the same gdi32 font code changes at least.
https://bugs.winehq.org/show_bug.cgi?id=50252
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |a0559ad5c3678527f7153da7f9e | |069ca05236b52
--- Comment #13 from Alexandre Julliard julliard@winehq.org --- This one is a real regression, it should be fixed by a0559ad5c3678527f7153da7f9e069ca05236b52.
Please open new bugs if there are other issues that can be reproduced with unpatched Wine and a clean prefix.
https://bugs.winehq.org/show_bug.cgi?id=50252
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression
https://bugs.winehq.org/show_bug.cgi?id=50252
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #14 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 6.0-rc3.