You are not logged in.

#1 2009-06-11 22:19:01

danielskoda
Member
Registered: 2009-02-24
Posts: 6

[SOLVED] Japanese input makes things weird

Hello everybody!

Well, recently I've reinstalled Arch Linux. Everything was ok (as well in the previous installation), but since I've installed the Japanese input/fonts, my fonts got weird into QT applications. But that happens only when I activate the input for QT apps! The following image will show you better what is happening:

capturadetelajapones26d.th.png

While the correct is:

capturadetelajapones26d.th.png

I call Anki with the following command:

export LC_CTYPE="ja_JP.utf8" && anki

I have the Japanese fonts installed in my computer and the locales.conf is set with the Japanese language. I use GNOME. Any ideas?

Thank you and apologise this bad written English.
Daniel

Last edited by danielskoda (2009-06-15 12:49:15)

Offline

#2 2009-06-11 23:41:13

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [SOLVED] Japanese input makes things weird

Try setting it to something different using qtconfig

I don't think it will make a difference but also try LC_CTYPE=ja_JP.UTF-8 qtconfig

By the way that export LC_CTYPE="..." && ... can have unwanted consequences because it will remain an environment variable afterwards which you will notice in future applications you run from that shell.

Offline

#3 2009-06-12 00:24:06

danielskoda
Member
Registered: 2009-02-24
Posts: 6

Re: [SOLVED] Japanese input makes things weird

Hello, thanks for your reply!
I've tried that 'LC_CTYPE=ja_JP.UTF-8 qtconfig' command. It is different from a normal 'qtconfig'. Its font is weird too.
I've set the font to DejaVu Serif and saved. The interface seemed to be ok with that font (I mean, the fonts looked normal), but, since I've closed that window, the default configuration settings were restored... And the weird font came back. :-(

Offline

#4 2009-06-12 00:28:18

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [SOLVED] Japanese input makes things weird

Did it not get stored in ~/.config/Trolltech.conf?

Offline

#5 2009-06-13 00:12:40

danielskoda
Member
Registered: 2009-02-24
Posts: 6

Re: [SOLVED] Japanese input makes things weird

Looks like that when I run a normal qtconfig the configuration don't get stored in this file (~/.config/Trolltech.conf)... When I run 'LC_CTYPE=ja_JP.UTF-8 qtconfig', the same happen: even if I change the fonts, for example, from Sans Serif to DejaVu Serif, the next time I'll open the 'LC_CTYPE=ja_JP.UTF-8 qtconfig' or a normal qtconfig, the changes I did will remain unchanged (the font Sans Serif stills there, as default).

Offline

#6 2009-06-14 22:40:51

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [SOLVED] Japanese input makes things weird

Could it be gnome that is interfering? I don't really know anything about it. (or qt)

Can you try it out in a non-gnome environment?

Offline

#7 2009-06-14 23:28:53

sokuban
Member
Registered: 2006-11-11
Posts: 412

Re: [SOLVED] Japanese input makes things weird

Why do you export the LC_CTYPE to Japanese when you start Anki? Does the Japanese input not work otherwise? (I have a Japanese IME and I have no problems with Qt apps without it, well I only have one Qt app I tested, fontmatrix.)

In fact, I just tried, and when I set LC_CTYPE to Japanese before starting fontmatrix, it started using iYaHei (a Chinese font O_o) for Latin characters. I guess setting LC_CTYPE to Japanese makes it choose the font highest on your priority list that can cover Japanese characters.

Offline

#8 2009-06-15 12:03:26

danielskoda
Member
Registered: 2009-02-24
Posts: 6

Re: [SOLVED] Japanese input makes things weird

Thanks for your reply.

Procyon, I'll try in a Xfce4 environment...
sokuban, you're right. if I do not export the LC_CTYPE, the japanese input won't work. Actually, I'm using SCIM to input. Perhaps the problem is with SCIM?
By the way, how do you define a default font for Asian Languages? Is it possible?
Maybe it'll help if I post my .xprofile here...

export XMODIFIERS='@im=SCIM' LC_CTYPE=pt_BR.utf8
export GTK_IM_MODULE='scim'
export QT_IM_MODULE='scim'
scim -d

Offline

#9 2009-06-15 12:48:48

danielskoda
Member
Registered: 2009-02-24
Posts: 6

Re: [SOLVED] Japanese input makes things weird

Solved!

Looks like that the problem was SCIM. Now I've installed UIM and everything works!
I still don't know how to set a default font for asian languages, but at least I can type in japanese correctly!

Thank you so much for your assistance,

Daniel

Offline

#10 2009-06-15 17:06:44

sokuban
Member
Registered: 2006-11-11
Posts: 412

Re: [SOLVED] Japanese input makes things weird

Oh, I know your problem. I should have noticed it earlier when you showed a screenshot of a program that wasn't in English, but I noticed it now when you posted your .xprofile file. A little too late now I guess.

http://wiki.archlinux.org/index.php/Sci … ated_files

You need to add your current locale to the supported unicode locales for scim to work with anything other than GTK programs.

But if uim works and you like it, you might as well just stick with uim.

As for defining a font for Asian languages, what do you mean? If you only use Japanese and not Chinese or Korean it shouldn't be much of a problem, you could just put a Japanese font there and it'll borrow from that by default. (Or do you have multiple Japanese fonts or something and you want to choose one?)

You can set a priorities list, by making certain fonts take priority over others, but you can't set a different font for each language because it is impossible for unicode to tell which language it is. This is my .fonts.conf:

<fontconfig>
    <alias>
        <family>Monospace</family>
        <prefer>
            <family>DejaVu Sans Mono</family>
            <family>Arial Unicode MS</family>
        </prefer>
    </alias>
    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>DejaVu Sans</family>
            <family>iYaHei</family>
            <family>Malgun Gothic</family>
            <family>Arial Unicode MS</family>
        </prefer>
    </alias>
    <alias>
        <family>serif</family>
        <prefer>
            <family>Times New Roman</family>
            <family>MS Mincho</family>
            <family>MingLiU</family>
            <family>MS Song</family>
            <family>UnBatang</family>
            <family>Arial Unicode MS</family>
        </prefer>
    </alias>
    <dir>/home/sokuban/.fontmatrix</dir>
</fontconfig>

So for example, "Sans" uses "DejaVu Sans" for Latin characters, and if "Sans" needs to display a glyph that "DejaVu Sans" doesn't have, it tries "iYaHei", then "Malgun Gothic" if "iYaHei" can't display it etc etc.

However, in firefox you /can/ set a different font for each language. It can be done from the GUI menu: Edit > Preferences > Content > Fonts & Colors

Last edited by sokuban (2009-06-15 17:20:12)

Offline

Board footer

Powered by FluxBB