http://bugs.winehq.org/show_bug.cgi?id=11281
Summary: CJK input many issues Product: Wine Version: 0.9.53. Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: hramrach@centrum.cz
Created an attachment (id=10369) --> (http://bugs.winehq.org/attachment.cgi?id=10369) An approximation of Japanese legacy application
There are so many issues I don't know where to start.
The good thing is the input sort of works so there must be something present in Wine that handles it one way or another. However, it is unusable in its current state.
First, a CJK font is needed which is not normally present in Wine. Also Wine cannot pull characters that do not exist in current font from other fonts so all relevant system fonts have to be mapped to something that actually contains the characters.
For Japanese the font Kochi Gothic is quite useful but it does not contain much in the latin range.
Now in the Wine notepad the Japanese characters are displayed only if you go to the font selection, select a font with Japanese characters, and select the Japanese script. I don't know why is that, some Latin accented characters are displayed even if Japanese script is selected but not the other way around.
Now typing Kana (and even Kanji) works with scim in notepad except the cursor is always positioned in front of the part just inserted (is not moved after inserting characters). Doing some cursor movement appears t orestore the cursor to the right position.
However, typical win32 application is codepage based, and would only work with SJIS encoding. After generating a SJIS Japanese locale and executing the included test application with LANG=ja_JP ./testwin.exe I get the text displayed correctly. Unfortunately, now the input does not work because scim runs in UTF-8, and wine in SJIS. This is the same as any other X applications run in that locale. However, starting a whole X session in an obscure Japanese locale is not a solution (although it seems the application would work).
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #1 from Michal Suchanek hramrach@centrum.cz 2008-01-19 14:40:14 --- Created an attachment (id=10370) --> (http://bugs.winehq.org/attachment.cgi?id=10370) the same, mingw source
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #2 from Michal Suchanek hramrach@centrum.cz 2008-01-19 14:44:49 --- Created an attachment (id=10371) --> (http://bugs.winehq.org/attachment.cgi?id=10371) registry patch to use Japanese fonts
This patch only crates substitutions for some system fonts to point to the Kochi fonts. It is part of wineloc .41 package (under GPL, found here: http://ubuntuforums.org/showthread.php?t=383628 )
http://bugs.winehq.org/show_bug.cgi?id=11281
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dank@kegel.com Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords| |patch, source Target Milestone|--- |1.0.0
--- Comment #3 from Dan Kegel dank@kegel.com 2008-01-19 19:06:15 --- Interesting. I hadn't heard of wineloc before.
I'm going to go out on a limb here and guess this is important enough to fix for 1.0. We can always change our minds.
http://bugs.winehq.org/show_bug.cgi?id=11281
Jan Ask janaskhoej@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |janaskhoej@gmail.com
--- Comment #4 from Jan Ask janaskhoej@gmail.com 2008-02-06 06:12:58 --- As a Japanese user, I would also like to get this fixed for 1.0. There is a lot of Chinese/Japanese software out there :)
Would a reward/bounty help?
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #5 from Michal Suchanek hramrach@centrum.cz 2008-02-26 13:02:24 --- I guess that won't help unless it's known how to do it. I know nobody who understands XIM. It's a wonder it even works.
The root of the problem in my view is that the input method runs in UTF-8 but the wine application in SJIS. Even plain X applications don't work like that.
The rest is only polishing rough edges.
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #6 from Alexandre Julliard julliard@winehq.org 2008-03-12 11:48:56 --- You should be using a utf-8 locale, something like ja_JP.UTF8. Wine will still show an appropriate DBCS codepage to Win32 apps, they won't see utf-8.
http://bugs.winehq.org/show_bug.cgi?id=11281
You-Cheng Hsieh yochenhsieh@xuite.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |yochenhsieh@xuite.net
http://bugs.winehq.org/show_bug.cgi?id=11281
Luke Hutchison luke.hutch@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |luke.hutch@gmail.com
--- Comment #7 from Luke Hutchison luke.hutch@gmail.com 2008-05-13 10:20:27 --- I'd just like to put a mention here of bug 8093, which discusses getting Windows IMEs (Google Pinyin specifically) working under Wine. The quality of Windows IMEs is generally much higher than that of Linux IMEs, especially in the case of Google Pinyin. I realize this bug is about getting Linux IMEs to work with Windows programs, but it would be great to get great CJK input method support working in both directions.
http://bugs.winehq.org/show_bug.cgi?id=11281
shakaran shakaran@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |shakaran@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=11281
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|1.0.0 |1.2.0
--- Comment #8 from Alexandre Julliard julliard@winehq.org 2008-05-27 13:27:54 --- No specific problem identified, deferring.
http://bugs.winehq.org/show_bug.cgi?id=11281
Michal Suchanek hramrach@centrum.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |hramrach@centrum.cz
--- Comment #9 from Michal Suchanek hramrach@centrum.cz 2008-06-01 17:55:05 --- Typing under ja_JP.UTF-8 does not work for me. The sample application displays correctly but typed non-ascii characters get lost somewhere, they never appear in the window.
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #10 from Muneyuki Noguchi nogu.dev@gmail.com 2008-10-13 03:03:46 --- FYI, I sent a patch to fix a bug in "over the spot" style to wine-patches.
http://www.winehq.org/pipermail/wine-patches/2008-October/063034.html
http://bugs.winehq.org/show_bug.cgi?id=11281
Michal Suchanek hramrach@centrum.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|CJK input many issues |CJK input: cannot type in | |legacy applications
--- Comment #11 from Michal Suchanek hramrach@centrum.cz 2008-10-13 08:32:03 --- Thanks for the patch. However, it looks like CJK input in general is not going to work anytime soon.
There are two major problems:
1) there are no Japanese fonts in wine. Once there is a Japanese font the displaying of Japanese applications should JustWork. They should be linked automatically. The same for Chinese or whatever. In Windows font linking is used to add the characters from MS Gothic to the system fonts, Arial, and whatnot.
2) it is impossible to type Japanese in legacy Windows applications (most applications as people are too lazy to update their code to use new runtime) without switching the whole system into an obscure Japanese locale. The same would probably apply to Chinese, etc. According to comment #6 it should work but it does not work for me.
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #12 from Austin English austinenglish@gmail.com 2009-04-17 12:07:42 --- Is this still an issue in current (1.1.19 or newer) wine?
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #13 from Jan Ask janaskhoej@gmail.com 2009-04-23 06:07:28 --- (In reply to comment #12)
Is this still an issue in current (1.1.19 or newer) wine?
Yes, This is still an issue in wine 1.1.19. Typing (or pasting) CJK characters into Notepad or any CJK programs just results in garbled text.
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #14 from Michal Suchanek hramrach@centrum.cz 2009-04-23 07:24:12 --- Which is probably not the issue this bug is about.
Does the attached application display correctly and receive CJK text when typed?
The application should receive garbage and display garbage in English locale.
In Japanese locale the application would display correctly if fonts worked in Wine (currently displays nothing when the attached registry hack is applied) and dueto the CJK input problem would receive nothing typed through CJK IMs.
I cannot test because UIM on Debian is broken.
http://bugs.winehq.org/show_bug.cgi?id=11281
Michal Suchanek hramrach@centrum.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Depends on| |13829, 18044
--- Comment #15 from Michal Suchanek hramrach@centrum.cz 2009-04-25 12:35:56 --- With SCIM I can type something I cannot see which is different from the original behaviour.
I can cut & paste from wine, though (finally!), and the pasted test seems ok.
I am running 1.1.15 Debian package.
The text is probably invisible due to bug 18044
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #16 from Jan Ask janaskhoej@gmail.com 2009-04-25 19:19:46 --- (In reply to comment #14)
Which is probably not the issue this bug is about.
Does the attached application display correctly and receive CJK text when typed?
The application should receive garbage and display garbage in English locale.
In Japanese locale the application would display correctly if fonts worked in Wine (currently displays nothing when the attached registry hack is applied) and dueto the CJK input problem would receive nothing typed through CJK IMs.
I cannot test because UIM on Debian is broken.
Sorry, I initially didn't understand what the bug was about.
I get the same result at Michael in comment #15. I can type and paste text into the application using Scim, but it is invisible. I am running Wine 1.1.19 on Kubuntu Jaunty in a Japanese locale.
Also, Kanji (although not hiragana and katakana) are rendered as squares in all wine menus. This is probably another bug, though.
http://bugs.winehq.org/show_bug.cgi?id=11281
Paul "TBBle" Hampson Paul.Hampson@Pobox.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |Paul.Hampson@Pobox.com
--- Comment #17 from Paul "TBBle" Hampson Paul.Hampson@Pobox.com 2009-04-25 21:09:19 --- This problem has nothing to do with bug 18044. Bug 18044 would only apply if the application was using MS Shell Dlg as the font for the edit box.
The test application in attachment 10369 and attachment 10370 is is sending SJIS text to WM_SETTEXT, which seems to work for me with LC_CTYPE=ja_JP.ut8 wine testwin.exe but not with plain wine testwin.exe.
The definition of WM_SETTEXT takes a TCHAR*, which is ASCII in ASCII builds and UCS-2 in Unicode builds.
To see what's going wrong in the test app, run it with WINEDEBUG=+font and search for GetTextExtentExPointW in the (huge) output. Under en_AU.utf8, I see
trace:font:GetTextExtentExPointW (0x1d8, L"Edit \201a\00a0\201a\00a2\201a\00a4\201a\00a6\201a\00a8", 0)
while under ja_JP.utf8 I see
trace:font:GetTextExtentExPointW (0x1d8, L"Edit \3042\3044\3046\3048\304a", 0)
As you can see, it's getting mangled quite badly before it tries to process it in the font code.
Anyway, getting correct font display for the test app (which uses the System font which pulls glyphs from Tahoma and its FontLinks under Wine) is simply a matter of having the correct FontLinks/SystemLinks entries for Tahoma (see bug 10864 comment 4 for an example, can be done through regedit as a REG_MULTI_SZ) and then the starting text will appear with LC_CTYPE=ja_JP.utf8, and pasting works (at least for me) under both locales.
http://bugs.winehq.org/show_bug.cgi?id=11281
Paul "TBBle" Hampson Paul.Hampson@Pobox.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |Paul.Hampson@Pobox.com Depends on|18044 |
--- Comment #17 from Paul "TBBle" Hampson Paul.Hampson@Pobox.com 2009-04-25 21:09:19 --- This problem has nothing to do with bug 18044. Bug 18044 would only apply if the application was using MS Shell Dlg as the font for the edit box.
The test application in attachment 10369 and attachment 10370 is is sending SJIS text to WM_SETTEXT, which seems to work for me with LC_CTYPE=ja_JP.ut8 wine testwin.exe but not with plain wine testwin.exe.
The definition of WM_SETTEXT takes a TCHAR*, which is ASCII in ASCII builds and UCS-2 in Unicode builds.
To see what's going wrong in the test app, run it with WINEDEBUG=+font and search for GetTextExtentExPointW in the (huge) output. Under en_AU.utf8, I see
trace:font:GetTextExtentExPointW (0x1d8, L"Edit \201a\00a0\201a\00a2\201a\00a4\201a\00a6\201a\00a8", 0)
while under ja_JP.utf8 I see
trace:font:GetTextExtentExPointW (0x1d8, L"Edit \3042\3044\3046\3048\304a", 0)
As you can see, it's getting mangled quite badly before it tries to process it in the font code.
Anyway, getting correct font display for the test app (which uses the System font which pulls glyphs from Tahoma and its FontLinks under Wine) is simply a matter of having the correct FontLinks/SystemLinks entries for Tahoma (see bug 10864 comment 4 for an example, can be done through regedit as a REG_MULTI_SZ) and then the starting text will appear with LC_CTYPE=ja_JP.utf8, and pasting works (at least for me) under both locales.
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #18 from Paul "TBBle" Hampson Paul.Hampson@Pobox.com 2009-04-25 21:53:02 --- (In reply to comment #17)
The definition of WM_SETTEXT takes a TCHAR*, which is ASCII in ASCII builds and UCS-2 in Unicode builds.
Sorry, that was crackful. It's local-charset in non-UNICODE builds, ie. based on codepage. SJIS in ja_JP.utf8 locale and US-ASCII in en_AU.utf8. That's why the test app only displays the starting text in ja_JP.utf8 locale, as expected.
Pasting works because the edit control appears to operate in Unicode even in a non-Unicode application.
I can't convince UIM to type into Wine either anymore on wine-1.1.20 (I thought it used to work...) so I can't actually test if this bug is fixed or not.
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #19 from Michal Suchanek hramrach@centrum.cz 2009-04-26 03:54:43 --- Yes, with a font link I was able to see the Japanese text in the application but not the Latin text (this includes both the initial Latin text and the Latin letters shown by the IM). So I guess bug 18044 probably applies here or there is another similar problem.
However, the IM finally works as expected - I can type kana and kanji in the application.
So I guess the IM problems are fixed in 1.1.15 but font problems remain.
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #20 from Paul "TBBle" Hampson Paul.Hampson@Pobox.com 2009-04-26 22:14:23 --- If you could see the Japanese but not the latin, that suggests that your font link was wrong, or something else has gone wrong. However bug 18044 doesn't affect the System font at all, as that is handled by a different block of code than the part that 18044 addresses. A +font log should indicate the problem you're having with the display. A missing Tahoma font for example might cause it.
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #21 from Michal Suchanek hramrach@centrum.cz 2009-04-27 02:51:01 --- OK, I will try to upgrade to a later wine release and if this does not resolve the issue I will file a separate bug.
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #22 from Michal Suchanek hramrach@centrum.cz 2009-04-27 05:57:55 --- ok, with Wine 1.1.19 the font link works although the text looks really ugly (anybody tried regedit in ja_JP.UTF-8 ?).
Interestingly it is possible to write Japanase in en_US.UTF-8 which should not be possible (the initial text is garbled, though, as expected).
So there is likely another issue.
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #23 from Paul "TBBle" Hampson Paul.Hampson@Pobox.com 2009-04-27 07:02:26 --- If the text is ugly, it's because your font replacements are wrong, so it's falling back to the first font that supports Japanese script (which on your machine is probably a very scripty one, similar to on mine).
A registry entry something like [HKEY_CURRENT_USER\Software\Wine\Fonts\Replacements] "MS Gothic"="Kochi Gothic" "MS Mincho"="Kochi Mincho" "MS PGothic"="Kochi Gothic" "MS PMincho"="Kochi Mincho" "MS UI Gothic"="Kochi Gothic"
should fix it, if you have the Kochi fonts installed. If you have the IPAMona fonts installed, try this instead, it's a more accurate replacement set. [HKEY_CURRENT_USER\Software\Wine\Fonts\Replacements] "MS Gothic"="IPAMonaGothic" "MS Mincho"="IPAMonaMincho" "MS PGothic"="IPAMonaPGothic" "MS PMincho"="IPAMonaPMincho" "MS UI Gothic"="IPAMonaUIGothic"
Not that using these, you have to change your FontLinks entries. The name can stay MS Gothic, but the filename must match the actual filename being loaded by Wine. See HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Fonts for a list of font names and the filename they match. Ignore the " (TrueType)" in the font name, and the path to the file, only the filename matters.
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #24 from Michal Suchanek hramrach@centrum.cz 2009-04-27 07:44:57 --- With the font replacements regedit looks much better but the application is still ugly. Lowercase letters seem bold compared to uppercase.
http://bugs.winehq.org/show_bug.cgi?id=11281
Michal Suchanek hramrach@centrum.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #10371|0 |1 is obsolete| |
--- Comment #25 from Michal Suchanek hramrach@centrum.cz 2009-04-27 07:57:26 --- Created an attachment (id=20749) --> (http://bugs.winehq.org/attachment.cgi?id=20749) registry patch to use Japanese fonts (with Kochi fonts from Debian Lenny)
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #26 from Paul "TBBle" Hampson Paul.Hampson@Pobox.com 2009-05-09 12:54:01 --- (In reply to comment #24)
With the font replacements regedit looks much better but the application is still ugly. Lowercase letters seem bold compared to uppercase.
This is a problem with the jvgasys.fon used as 'System', which is what you get if you don't otherwise select a font. See bug 18349 (particularly bug 18349 comment 11)
At this point it sounds like input (which is what this bug appears to be about) is working according to comment 15.
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #27 from Michal Suchanek hramrach@centrum.cz 2009-05-09 15:16:53 --- Yes, it seems to work.
However, I would like to confirm with something other that this test application, preferably something that can generate some output that can be verified as properly encoded.
Also the ability to input Japanese characters into the test application in English locale is somewhat odd.
http://bugs.winehq.org/show_bug.cgi?id=11281
--- Comment #28 from Paul "TBBle" Hampson Paul.Hampson@Pobox.com 2009-05-10 03:20:49 --- (In reply to comment #27)
Also the ability to input Japanese characters into the test application in English locale is somewhat odd.
The edit control used by the test application (and Wine's notepad, I believe) is unicode-enabled (wide chars), so it's supposed to work irrespective of locale, modulo font settings (which can be made to work irrespective of locale) and the fact that the test application sends SJIS text into the control via the ANSI character interface, which gets mangled when the locale ANSI charset is not SJIS, which is the point of the application, as I understand its description here. (See comment 17 for more detail on the charset issue)
That should be a different bug, this bug is already much too multipronged as it is.
http://bugs.winehq.org/show_bug.cgi?id=11281
Michal Suchanek hramrach@centrum.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #29 from Michal Suchanek hramrach@centrum.cz 2009-05-27 11:50:56 --- Closing as per explanation in the previous comment.
http://bugs.winehq.org/show_bug.cgi?id=11281
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #30 from Alexandre Julliard julliard@winehq.org 2009-06-05 12:38:56 --- Closing bugs fixed in 1.1.23.