Winetricks / winetricks

Winetricks is an easy way to work around problems in Wine
GNU Lesser General Public License v2.1
2.73k stars 399 forks source link

fakechinese missing font replacement #462

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Installing the Kugou music player (as per 
https://bugs.winehq.org/show_bug.cgi?id=5971#c18) revealed that a font 
replacement is missing from fakechinese.

We need to replace "\x5b8b\x4f53" with "WenQuanYi Micro Hei". "\x5b8b\x4f53" is 
the equivalent of "宋体", which is specified here:

http://wiki.winehq.org/FontReplacements?action=AttachFile&do=get&target=0001-loa
der-wine.inf.in-Added-localized-font-name-replaceme.txt

"新細明體" -> "WenQuanYi Micro Hei" is also missing from winetricks' 
replacement list, but Kugou does not benefit from it.

Original issue reported on code.google.com by r...@gentoo.org on 5 Jan 2015 at 2:33

GoogleCodeExporter commented 9 years ago
What's the version of your winetricks?
This problem should have been fixed in git.

If the git version still has problems, please test this patch

Original comment by litimetal on 7 Jan 2015 at 6:03

Attachments:

GoogleCodeExporter commented 9 years ago
The git version has not been patched:

https://code.google.com/p/winetricks/source/browse/src/winetricks

Anyway, I had written a similar patch locally, except it used "\x5b8b\x4f53" 
instead of "宋体" and did not include "新細明體". If you edit the 
registry manually, you will find that wine converts the unicode representation 
to that ASCII escape sequence when it has a chance to update the registry.

Original comment by r...@gentoo.org on 8 Jan 2015 at 5:42

GoogleCodeExporter commented 9 years ago
Does that patch work for both of you?

Original comment by austinenglish@gmail.com on 14 Jan 2015 at 10:05

Endle commented 8 years ago

I tried my patch, and it didn't work.

Anyway, I had written a similar patch locally, except it used "\x5b8b\x4f53" instead of "宋体" and did not include "新細明體". If you edit the registry manually, you will find that wine converts the unicode representation to that ASCII escape sequence when it has a chance to update the registry.

Original comment by r...@gentoo.org on 8 Jan 2015 at 5:42

Seems that we need to encode the font name with ANSI, but I have no idea of how to solve it.

austin987 commented 8 years ago

@Endle, could you find the entries in ~/.wine/*.reg and paste the before/after versions of the names?

Endle commented 8 years ago

@austin987 I followed these procedures:

  1. add the patch to winetricks
  2. backup ~/.wine/_.reg
  3. run winetricks fakechinese
  4. compare old/new ~/.wine/_.reg

system.reg.diff.txt user.reg.diff.txt

austin987 commented 8 years ago

@Endle is that with your patch and running regedit?

Endle commented 8 years ago

@Endle is that with your patch and running regedit?

Sorry, I didn't get your point.

austin987 commented 8 years ago

I'm referring to what you said here: https://github.com/Winetricks/winetricks/issues/462#issuecomment-206219973

I'd like to see what the registry looks like when it is in a good state

Endle commented 8 years ago

I'm referring to what you said here: #462 (comment)

Yes, I got these result with my patch. I assume this patch is broken due to this:

screenshot with patch

I'd like to see what the registry looks like when it is in a good state I edited the name via wine regedit, then I got via_regedit_user.reg.diff.txt

austin987 commented 8 years ago

Thanks, that's exactly what I needed.

austin987 commented 8 years ago

@Endle, could you try this branch https://github.com/Winetricks/winetricks/tree/issue-462-fakechinese-fix-encoding (on a system with python3 installed) please?

Endle commented 8 years ago

@austin987 WIth your patch, With locale=zh_CN.utf8, I got

[Software\\Wine\\Fonts\\Replacements] 1460625544
#time=1d1962eb09e29c2
"\\\\x5b8b\\\\x4f53"="WenQuanYi Micro Hei"
"\\\\x65b0\\\\x7d30\\\\x660e\\\\x9ad4"="WenQuanYi Micro Hei"

zh_CN.utf8

I also tried export LC_ALL=ja_JP.UTF-8, the result is the same as expected(as I set them to UTF8)

[Software\\Wine\\Fonts\\Replacements] 1460626090
#time=1d1962ff63a0c2a
"\\\\x5b8b\\\\x4f53"="WenQuanYi Micro Hei"
"\\\\x65b0\\\\x7d30\\\\x660e\\\\x9ad4"="WenQuanYi Micro Hei"

Besides, I don't know how does https://bugs.winehq.org/show_bug.cgi?id=5971#c18 relate to this issue. Hope that's what you need.

austin987 commented 8 years ago

@Endle I'd like to know if it fixes the application's font problem. I don't read Chinese so I can't easily test myself :)

Endle commented 8 years ago

@austin987 Sorry, I can't reproduce the bug that Richard Yao described on Wine's bugzilla. More precisely, I don't know what he meant by "not fully usable". I can do some tests on the software Yao described (KuGou), then send a bunch of bug reports, but I don't think I can get his point.

Can we invite him to join this discuss?

austin987 commented 8 years ago

Of course.