Page 1 of 9 123 ... LastLast
Results 1 to 10 of 85

Thread: HOWTO: CJK in Wine (Chinese, Japanese & Korean)

  1. #1
    Join Date
    Jan 2007
    Location
    Beijing, China
    Beans
    61

    HOWTO: CJK in Wine (Chinese, Japanese & Korean)

    The system I tested it on was 32-bit Ubuntu Feisty 7.04.

    The guide is provided at users' own risk. I will try to provide support and answer questions in the thread, but if you somehow type something wrong and send your OS spiraling into /dev/null, don't blame me.


    UPDATE: The new WineLocale 0.41 attached to this thread also supports Arabic, Greek, Hebrew and Russian. It is no longer CJK only. However, because this thread is marked CJK in Wine, I won't add the directions to it. Download the file and follow the extra steps in INSTALL to get these languages working.

    OK, the web proved totally unhelpful for me to figure this out, so I imagine some of your out there in Ubuntu user-land are having the same problems.

    Ordinarily, running a CJK application in Wine results in lots of garbled text. On a good day, you will get empty boxes. On a bad day, it looks like the ASCII table exploded.

    No more. I put together a little shell script called WineLocale (after Microsoft's AppLocale which solves the same problem on Windows). So far, it only supports Japanese, Korean, Simplified Chinese and Traditional Chinese. I don't know enough about Hebrew, Arabic and Russian to add those. If you want to help out, by all means. Read ~/.wineloc/patches/HOWTO after installing.

    The below directions are all in WineLocale's INSTALL file, but I've repeated them here because they have great generic use for anyone wondering about locales.

    Just a note, purgelocales is not a solution because it refuses to show non-ASCII compatible mappings (for example, SJIS, which all pre-XP Japanese applications are).

    Step 1: Getting the Locales

    Execute the following:
    Code:
    $ cd /var/lib/locales/supported.d/
    # touch ja
    # touch ko
    # touch zh
    Now open up the three files in a text editor and make certain each contains the following lines.

    /var/lib/locales/supported.d/ja
    Code:
    ja_JP.UTF-8 UTF-8
    ja_JP SJIS
    ja_JP.EUC-JP EUC-JP
    /var/lib/locales/supported.d/ko
    Code:
    ko_KR.UTF-8 UTF-8
    ko_KR.EUC-KR EUC-KR
    /var/lib/locales/supported.d/zh
    Code:
    zh_CN.UTF-8 UTF-8
    zh_TW.UTF-8 UTF-8
    zh_CN GB2312
    zh_CN.GBK GBK
    zh_CN.GB18030 GB18030
    zh_TW Big5
    If the lines are there and everything is saved, run:

    Code:
    # dpkg-reconfigure locales
    It will throw a warning about SJIS, but trust me, it's OK. Run the command again and everything will say "up-to-date" this time.

    Next, prepare for a hellishly long download depending on which fonts you have installed (and if you live in, say, China, like me--our Ubuntu mirror sucks)

    Code:
    # apt-get install ttf-arphic-ukai ttf-arphic-uming ttf-kochi-gothic ttf-kochi-mincho ttf-mikachan ttf-mona ttf-sazanami-gothic ttf-saxanami-mincho ttf-vlgothic ttf-alee ttf-arphic-ukai ttf-arphic-uming ttf-baekmuk ttf-unfonts ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp ttf-arphic-gkai00mp ttf-arphic-ukai ttf-arphic-uming
    Next up, even with all those installed, we will be missing a true Chinese font that handles multiple encodings. Don't suggest any of the AR fonts. It will FAIL on the menu bar of a Wine application. This step is necessary.

    We will install Vera Sans YuanTi provided by the Chinese Ubuntu project. Sadly, there's no easy package for this one. We have to do:

    Code:
    $ wget http://download.ubuntu.org.cn/software/VeraSansYuanTi.tar.gz
    $ tar -zxpvf VeraSansYuanTi.tar.gz
    # mv VeraSansYuanTi /usr/share/fonts/
    # fc-cache -f
    # cp /etc/fonts/fonts.conf /etc/fonts/fonts.conf.old
    # cp /usr/share/fonts/VeraSansYuanTi/fonts.conf /etc/fonts/
    If you check the INSTALL file of WineLocale, you'll find information about installing Windows fonts. I will leave it out of this guide, because even without those we will get a fully functioning CJK Wine this way If you want the exact same fonts found in Window, follow that part of the guide.

    Step 2: Stealing a nice Wine setup

    The default ~/.wine/drive_c created when you run Wine sucks. Hard. It would take a lot of configuring to get something usable, so instead of suffering that, we'll steal one.

    Your best bet is to get one from the IEs4Linux project. They provide an amazing setup that, when complete, will contain most of the major system DLLs. I find many applications Wine cannot normally run work fine when I use the IEs4Linux setup. So that's what this guide recommends you do.

    Make sure your apt-get sources.list has universe and multiverse enabled, then run the following:

    Code:
    # apt-get update
    # apt-get install cabextract wine
    $ wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
    $ tar zxpvf ies4linux-latest.tar.gz
    $ cd ies4linux-*
    $ ./ies4linux
    Run the new "ie6" command once and close it. Now do:

    Code:
    $ rm -rf ~/.wine/*
    $ cp -r ~/.ies4linux/ie6/* ~/.wine/
    Step 3: Install WineLocale

    Download WineLocale from my website <http://www.cinnamonpirate.com/software/winelocale/> or grab it with wget:

    Code:
    $ wget http://www.cinnamonpirate.com/pub/software/sh/wineloc-0.41.tar.gz
    $ tar zxpvf wineloc-0.41.tar.gz
    $ cd wineloc-0.41
    $ ./install
    This will install the WineLocale default files in /usr/local/share/wineloc and create a symlink in /usr/local/bin. You can now run "wineloc" from anywhere on your system.

    Step 4: Using WineLocale

    WineLocale, at base, is extremely easy to use. The simplest command line is:

    Code:
    $ wineloc -l zh_CN /path/to/executable.exe
    -l is the locale flag. If omitted, WineLocale will run it in your current system locale. Valid options are:
    [*]ja_JP - Japanese[*]ko_KR - Korean[*]zh_CN - Chinese (Simplified)[*]zh_TW - Chinese (Traditional)

    zh_HK and zh_SG will just alias to the other two Chinese modes if you use them. There is also a -o flag that will let you enable DLL overrides (use real DLLs instead of Wine's). This option is tied to a IEs4Linux created Wine setup. If you didn't use theirs, don't touch it or evil magic may happen. Hey, don't complain about "choice": you have the choice not to follow this guide

    There's also one more option, -f, which lets you specify a different font group. "common" is the default, but there is also a "win" packed in if you followed the guide to install Windows fonts.

    You can create your own font themes and overrides if you explore ~/.wineloc/patches, but that's a topic for another guide.

    If you followed everything so far, congratulation, you can now run CJK applications in Wine. On launch, the registry will be hacked up to fit your locale. On exit, everything reverts back to the default so your normal Wine applications won't exhibit any odd behavior. If you manage to "crash" it so settings get stuck, you can run this command to reset all font preferences. Ignore any "errors":

    Code:
    $ regedit /usr/local/share/wineloc/patches/default.reg
    If you check my website, you can see pictures of CJK applications running using WineLocale. To get your Wine applications looking close to the rest of your UI, you need to use "winecfg". Check section iii of INSTALL, "Configuring Wine with winecfg," to see how to do this.

    Have fun
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by D--; July 2nd, 2007 at 06:03 AM.

  2. #2
    Join Date
    Dec 2006
    Location
    Canada
    Beans
    31

    Re: HOWTO: CJK in Wine (Chinese, Japanese & Korean)

    thank you!
    this post has been so helpful, I have spent countless hours of googling trying to get japanese fonts to display in wine, without so much as a hint of progress until I found this guide.
    Last edited by Jeremy Jackins; May 6th, 2007 at 08:43 PM.

  3. #3
    Join Date
    Jan 2007
    Location
    Beijing, China
    Beans
    61

    Re: HOWTO: CJK in Wine (Chinese, Japanese & Korean)

    No problem. Glad to hear it helped.

    Trust me, I did the same. When Google proved to be absolutely no help, I realized no one had ever done this before and decided to work it out myself

    Everything works good I trust? I'm glad to hear one other user has tested my guide and confirmed it works.

  4. #4
    Join Date
    Dec 2006
    Location
    Canada
    Beans
    31

    Re: HOWTO: CJK in Wine (Chinese, Japanese & Korean)

    there were one or two buttons in the installation I was running that didn't display correctly, but aside from that everything has worked perfectly so far.

  5. #5
    Join Date
    Jan 2007
    Location
    Beijing, China
    Beans
    61

    Re: HOWTO: CJK in Wine (Chinese, Japanese & Korean)

    Hi, what installer?

    Generally this would be caused if they manually specified a font which is getting mapped to one on your system (for example, if you installed the win32 fonts package). You can solve this by editing one of the .reg files for your locale, adding that font, and mapping it to one with the correct locale.

    The one fall-through in this is rally that hard-mapping of fonts. Say, for example, they use Arial. Well, on Japanese Windows, maybe it will shove in the missing characters from one of the Japanese fonts. However, on Wine, you don't have this link. You have to totally swap Arial with one that will have the glyphs you need. It's kind of a bummer, but that's just how it works.

  6. #6
    Join Date
    Oct 2005
    Location
    Shanghai
    Beans
    1,181
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: HOWTO: CJK in Wine (Chinese, Japanese & Korean)

    Next, prepare for a hellishly long download depending on which fonts you have installed (and if you live in, say, China, like me--our Ubuntu mirror sucks)
    dont want to hijack the thread or anything but these mirrors are quite fast:
    Code:
    deb http://ubuntu.cn99.com/ubuntu/ dapper main restricted universe multiverse
    deb http://ubuntu.cn99.com/ubuntu/ dapper-updates main restricted universe multi verse
    deb http://ubuntu.cn99.com/ubuntu/ dapper-security main restricted universe mult iverse
    deb http://ubuntu.cn99.com/ubuntu/ dapper-backports main restricted universe mul tiverse
    deb http://ubuntu.cn99.com/ubuntu-cn/ dapper main restricted universe multivers

  7. #7
    Join Date
    Dec 2006
    Location
    Canada
    Beans
    31

    Re: HOWTO: CJK in Wine (Chinese, Japanese & Korean)

    it was the installer for Kanon, one of those visual novel dealies. it wasn't much of a problem at all, I just got <<<<<<< for text on a couple of accept/cancel buttons. this hasn't shown up anywhere else so I'm not going to worry about it =/

    on a side note, borrowing a wine setup from Es4Linux is a really nice trick that has helped me out in a few cases now. I wonder why wine doesn't include more DLLs like that on their default install? legal issues I guess.

  8. #8
    Join Date
    Jan 2007
    Location
    Beijing, China
    Beans
    61

    Re: HOWTO: CJK in Wine (Chinese, Japanese & Korean)

    Out of curiosity, was it with the Linux font setup or Windows font setup?

  9. #9
    Join Date
    Jan 2007
    Location
    Beijing, China
    Beans
    61

    Re: HOWTO: CJK in Wine (Chinese, Japanese & Korean)

    URGENT: If you are running Feisty, DO NOT INSTALL UPDATES RIGHT NOW. A new round of updates that rolled out in the last 24 hours has smashed locale support. You cannot install SJIS, GB2312 or GB18030 anymore. This means WineLoc will fail at running Japanese and Simplified Chinese software. At the moment, only Korean and Traditional Chinese are still working.

    I've posted about it in this thread. Hopefully someone comes up with an answer, or a new round up updates is quickly released to fix the problem.

    EDIT: I've worked out a fix. If you update and these locales suddenly quit working, open the Ubuntu Language Support tool and uncheck Japanese and Chinese. Click apply, then close. Repeat the directions in my INSTALL file to add the locales again to /var/lib/locales/supported.d/, run a `dpkg-reconfigure locales` and log out of gdm. When you log back in, everything will work fine again.
    Last edited by D--; April 16th, 2007 at 06:07 AM.

  10. #10
    Join Date
    Dec 2006
    Location
    Canada
    Beans
    31

    Re: HOWTO: CJK in Wine (Chinese, Japanese & Korean)

    Quote Originally Posted by D-- View Post
    Out of curiosity, was it with the Linux font setup or Windows font setup?
    I'm not 100% sure, I didn't specify the -f option if that's what you mean so I suppose I was using the linux font setup.

Page 1 of 9 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •