Japanese font switching issue

Bug #219931 reported by rogmorri
14
Affects Status Importance Assigned to Milestone
Ubuntu
Invalid
Low
Unassigned

Bug Description

Actually, there are two separate issues, See attached screen shot.

Firstly, as I'm entering Japanese text (into Nautilus, or Firefox, or wherever), when I type Japanese hiragana characters it seems to switch to one font, then when I type Japanese kanji characters, it seems to switch to another. From a brief inspection, it seems that all the installed fonts either contain no Japanese characters, or contain both hiragana and kanji characters. So, why is it switching between fonts like that?

Secondly, the default font seems to vertically center the Japanese comma and period characters. What's up with that? I'm not a Japanese expert, but I think this is as abnormal in Japanese as centering a comma or period in English text would be.

When combined, the above two issues are especially annoying. The comma character moves up and down in the same sentence, depending on what character was before it.

Actually, as I type this, I realize why a font would have a vertically-centered comma and period like that -- this would be appropriate for vertical text. So perhaps the question is, why is a vertical font being selected or why does the font engine thing I'm typing vertically?

For reference, here is the text from the attached screen shot...
AAA、。あああ、。曲、。あ、。
(The comma and period are u3001 and 3002, the hiragana character is u3042, and the kanji is u66f2)

Ubuntu 8.04 beta, no compiz, Japanese language installed and default font size set to 12, but otherwise everything is pretty-much as one would get from a fresh install. (The same issues are seen when font size is 10, the default). I've only tried this under gnome.

Revision history for this message
rogmorri (frontporsche) wrote :
Revision history for this message
Rolf Leggewie (r0lf) wrote :

What version of ubuntu are you using? My feeling tells me this is a configuration issue. FWIW, I don't see the vertically-centering problem here. Can you create a new user and log in as this user to see if the problem remains the same?

Revision history for this message
rogmorri (frontporsche) wrote :

I tried this:
  - created a new user
  - rebooted
  - logged in as that user
  - selected "Enable support to enter complex characters" under "Language Support".
  - this forced me to reboot again
  - logged in again as that new user
  - The problem was still there.

Well, if you can't reproduce it, I'll try re-installing and see what happens.

Revision history for this message
rogmorri (frontporsche) wrote :

I did a complete re-install with the released 8.04 image. All I did was enable Japanese support, including "enter complex characters" support, and the problem was there. Screen shot attached.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

> Firstly, as I'm entering Japanese text [...] it seems to switch to one font, then when I type Japanese kanji characters, it seems to switch to another.

I have reported this as bug 222228

> Secondly, the default font seems to vertically center the Japanese comma and period characters.

Well, not all the time which is especially odd. Look at your attachment from the 20th. The first and last comma-period combination is, but the one in the middle is not. Very strange. But I am not seeing it as well.

Revision history for this message
rogmorri (frontporsche) wrote :

This seems to happen in text fields in various gtk applications and in web pages rendered with Firefox (including this current page), but I don't see this in kde applications.

Revision history for this message
olofsj (olofshopping) wrote :

I had the same problem, and doing the following fixed it for me:

$ cd /etc/fonts/conf.d/
$ sudo ln -s ../conf.avail/29-language-selector-ja-jp.conf

After this you have to restart X for the new settings to take effect.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Thank you for the information. I don't have that file on my system. It seems to be a part of the package language-selector-common. rogmorri, do you that file and package?

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Arne, please excuse me for bluntly subscribing you to this bug. But my research indicates you have a great deal of interest and knowledge with regards to Asian fonts on Ubuntu. Can you help us?

Revision history for this message
Arne Goetje (arnegoetje) wrote :

It seems that you are not using ja_JP as your default locale. Therefor, the system is switching between Chinese and Japanese fonts while typing. This is because Pango doesn't know whether you are typing Chinese or Japanese, as the characters (even Hiragana) are included in both font sets, but rendered a bit differently in regard to punctuation marks. This is actually a feature of Pango and not a bug.

To tell the system, that you prefer Japanese fonts in any case you'll need to type the following in a terminal window:

fontconfig-voodoo -f -s ja_JP

(when selecting Japanese as your default session language in language selector, this would be done automatically for you).

Revision history for this message
rogmorri (frontporsche) wrote :

Yes, thank you. "fontconfig-voodoo -f -s ja_JP" made everything good. :)

Revision history for this message
Arne Goetje (arnegoetje) wrote :

closing as this is not a bug, but expected behavior (a bit annoying, I agree, but nothing wrong with it).

Revision history for this message
Thomas Fritzsche (tf-noto) wrote :

Hi Arne Goetje,

I was happy the "fontconfig-voodoo -f -s ja_JP" worked for me first. However then I notice that the German Umlaute: (ÜÖÄßüöä) doesn't work any more.
Is there a way to tweak the system to display German and Japanese character correct.
I now run "fontconfig-voodoo -f -r" to remove the Japanese setting, because "Romanji" text looks really ugly with it. (looks like it's using Japanese font for Romanji text with it.

Any ideas? Is there a way to find out what Chinese font is always causing problem and remove them all from the system?

Have a nice day!
Thomas

Revision history for this message
Thomas Fritzsche (tf-noto) wrote :

Ok.... I answered my own question:
I just tried myself. I removed all fonts that look like Chinese font. As written above, I also removed the fontconfig setting with "fontconfig-voodoo -f -r", not it looks better with Japanese and German.
I set the status back... Have a nice day!

Revision history for this message
Arne Goetje (arnegoetje) wrote :

Thomas,

it's not the fonts which cause these issues, it's the fontconfig configuration on your system, which prefers certain fonts over others in specific situations. As the ja_JP setting in fontconfig-voodoo is optimized for Japanese users who do not use extended Latin characters, this is indeed expected behavior. If you prefer DejaVu or any other font fir Latin script, I suggest that you copy /etc/fonts/conf.avail/69-language-selector-ja-jp.conf to ~/.fonts.conf, then edit this file and add the DejaVu or other font entries at the top of each font list for serif, sans-serif and monospace. This should fix your problem.

Revision history for this message
Thomas Fritzsche (tf-noto) wrote :

Hi Arne,

thanks so much for the comment! You are absolutely right, deinstalling the Chinese fonts is just a workaround.
For the moment at least it works. :-)
Indeed I had a look at the documentation of this XML format that time, but I thought this takes at least 1-2 hours reading the docs. I understand this XML gives you all possibility to define you preferences, but I wished there is a simple dialogue to maintain at least a simple list of preferred fonts.
(maybe a future release :-))

I think I'll probably give it a try when I have a little time, because the "default" choice of Japanese fonts is quite bad. (There is anyway only a little number of good Japanese fonts available.)
Linux is not very popular here in Japan.
Greetings from Tokyo,
Thomas

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Just in case anyone ever comes around to be looking for a solution to display Japanese and German properly while retaining Chinese fonts on their system, here is what I did. So far, it works quite nicely for me.

Revision history for this message
rogmorri (frontporsche) wrote :

Not that anyone cares, but without the "fontconfig-voodoo -f -s ja_JP" fix, this continues to happen in Ubuntu 8.10.

Revision history for this message
areteichi (areteichi) wrote :

I actually looked at this thread (https://bugs.launchpad.net/ubuntu/+source/fontconfig/+bug/36761)
because simply turning the default language sacrifices the font smoothing or font rendering.

What I did was, I created ~/.fonts.conf as mentioned above by copying 69-language-selector-ja-jp.conf.
I then added DejaVu fonts into fonts.conf as the first font setting for all three sections in the file, and I also added the following code (taken from the other thread linked above):
<fontconfig>
 <match target="font">
  <test name="lang" compare="contains">
   <string>ja</string>
  </test>
  <edit name="embeddedbitmap" mode="assign">
   <bool>false</bool>
  </edit>
  <edit name="autohint" mode="assign">
   <bool>true</bool>
  </edit>
  <edit name="antialias" mode="assign">
   <bool>true</bool>
  </edit>
  <edit name="hintstyle" mode="assign">
   <const>hintnone</const>
  </edit>
 </match>
</fontconfig>

I attached my .fonts.conf which maintains the good Latin characters as well as Japanese characters (both fonts are smoothed and anti-aliased).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.