Without ja_JP as default environment, Japanese font looks horrible for certain font sizes

Bug #36761 reported by agrueneberg
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
fontconfig (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Since one of the last updates the Japanese font on my system started to look horrible. At first I was playing around with fonts.conf, but I wasn't able to solve the problem. Using gedit I realized that it looks just like before if the font size is 8, 14 or anything above 16. It's a pity that these sizes are way too big or too small to use them. What's the problem?

I will add some pictures, if I can figure out how to do that.

Revision history for this message
agrueneberg (agrueneberg) wrote : font size 12

font size 12:
Looks horrible.

Revision history for this message
agrueneberg (agrueneberg) wrote : font size 14

font size 14:
Looks nice!

description: updated
Revision history for this message
agrueneberg (agrueneberg) wrote : Re: Japanese font looks horrible for certain font sizes

Adding the following code to ~/.fonts.conf did it for me:

<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>

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

Do you have the package "language-selector" installed? Do you use a ja_JP locale as default?Can you please give me the output of:
$ ls -l /etc/fonts/language-selector.conf
?

Thanks,
 Michael

Changed in fontconfig:
assignee: nobody → mvo
status: Unconfirmed → Needs Info
Revision history for this message
agrueneberg (agrueneberg) wrote :

I don't use ja_JP locale as default, because I'm learning Japanese as a foreign language. I have the package "language-selector" installed and already tried to switch completely to a Japanese desktop. I realized that there's a file called language-selector.conf in /etc/fonts/ (which links to /usr/share/language-selector/fontconfig/ja_JP) with everything needed to display the font nicely. Unfortunately all the other fonts began to look fuzzy, so I limited the content of the file to the Japanese language, which seems to work.

<test name="lang" compare="contains">
 <string>ja</string>
</test>

Here's the output of ls -l /etc/fonts/language-selector.conf:
lrwxrwxrwx 1 root root 44 2006-03-27 18:17 /etc/fonts/language-selector.conf -> /usr/share/language-selector/fontconfig/none

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for this information.

I asked the japanese comunity about the fontconfig file and the current /usr/share/language-selector/fontconfig/ja_JP is what they gave me.

It seems that currently it always a trade-off. Either good ja charackters or good latin ones (interesstingly the comunity seems to not like the idea of using language-specific settings like you did).

Thanks,
 Michael

Changed in fontconfig:
assignee: mvo → nobody
status: Needs Info → Confirmed
description: updated
Revision history for this message
Sancho (ichsan) wrote :

I found the same problem too in KDE since Edgy (until now: Gutsy). I've been using Japanese in English environment. Because I just want to learn Japanese. I found that some of the Japanese characters are unreadable. They look like some characters is missing. But later I try this:
LC_CTYPE="ja_JP.UTF-8" kiten

The font is back again. Do I have to change my environment just to show Japanese fonts correctly? Please see the comparison in my attachment file.

Please fix this before Hardy is released. Thanks

Revision history for this message
areteichi (areteichi) wrote :

>Evoreth

How can your solution be done in Ubuntu 9.10?
I am unable to find fonts.conf or language-selector.conf.

I guess the method of setting the configuration has been changed in a more recent Ubuntu version?
Can anyone offer me help?

Revision history for this message
areteichi (areteichi) wrote :

Ok, I was able to fix everything the way I had wanted.
I looked at some of the comments made for this bug (https://bugs.launchpad.net/ubuntu/+bug/219931)

There, someone mentions that:
>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.

So I created ~/.fonts.conf 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 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).

Revision history for this message
catphive (catphive) wrote :

I'm also using both japanese and english, with the default english install.

The fonts seemed to be just missing geometry in some of the more complicated kanji... I'm not a native japanese speaker, but I *think* it was just because the fonts were bad, and not a legitimate variation in the font. Either way, they were difficult to read.

Installing areteichi's .font.conf on ubuntu 9.10 gave me nicer japanese fonts, without messing up the normal english ones.

I see this bug is unassigned and dates to 2006... If a dev comes across this I encourage them to merge in areteichi's changes and not delay further.

There's way too many little glitches like this, with fixes just sitting in the bug tracker... please put this in svn.

Revision history for this message
areteichi (areteichi) wrote :

Yeah it is quite frustrating how little attention this problem is receiving. The only problem with the fix is that Japanese characters turn into squares in adobe flash player. I've played around with the .font.conf and the only way to avoid that is to go back to the ugly, unpolished fonts either in Latin or Japanese. I'm basically giving up the Japanese readability in flash until someone fixes this problem.

Revision history for this message
areteichi (areteichi) wrote :

Flash Player problem can be solved by using the latest Flash Player beta.
http://code.google.com/p/chromium/issues/detail?id=19926#c19

Found this solution from this bug report:
https://bugs.launchpad.net/ubuntu/+source/flashplugin-nonfree/+bug/472787

Revision history for this message
Victor Vargas (kamus) wrote :

@agrueneberg, sorry for the delayed reply but please could you check if this issue is still affecting you under latest release included in Ubuntu Lucid? Thanks in advance.

Changed in fontconfig (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Rolf Leggewie (r0lf) wrote :

I cannot reproduce this. Closing the ticket. By all means, please reopen if you are still affected.

Changed in fontconfig (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Benedikt Gollatz (benedikt) wrote :

I can confirm this for lucid. Here's a screenshot what the front page of http://ja.wikipedia.org/ looks like in Firefox on my system.

Changed in fontconfig (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Benedikt Gollatz (benedikt) wrote :

I should add that I have activated "hintslight" as hintstyle for all fonts in ~/.fonts.conf in order to get proper sub-pixel hinting in Firefox in the first place. Adding areteichi's configuration for Japanese fonts fixes the problem for me.

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

Benedikt, what are you complaining about specifically? Your screenshot looks fine to me.

Revision history for this message
areteichi (areteichi) wrote :

>Rolf Leggewie

Well if you've seen Japanese fonts with proper rendering, you would know what is wrong with the fonts in his screenshot.
With my configuration I put above, the fonts look like this

Revision history for this message
areteichi (areteichi) wrote :

Any updates on this bug? It's been exactly 5 years since this bug report was first opened! (not to mention that there hasn't been any progress since...)

I will post the most current version of '.fonts.conf' I use (since there have been some updates in Ubuntu for both Latin and Japanese fonts). Just rename the attached file to '.fonts.conf' (add a period/full stop at the beginning of the filename) and place it in your home folder (so that the location of the file should be: /home/username/.fonts.conf ).

Revision history for this message
Ahmad Syukri Abdollah (syockit) wrote :

agrueneberg and Benedikt's problem is due to embedded bitmap not disabled. Using 'sudo fontconfig-voodoo -l ja_JP' or 'sudo ln -s /etc/fonts/conf.avail/69-language-selector-ja-jp.conf -t /etc/fonts/conf.d/' will remedy it.

In Sancho's case, it seems the default is to select a chinese font (Kaiti?) which is higher in preference according to 40-nonlatin.conf, while when using ja_JP.UTF-8 locale, it seems to use FreeSans (if I'm not mistaken, FreeSans would give that horrible Han typeface). He should also do the solution above, and install better fonts (Takao/IPA fonts recommended).

By the way, even with the voodoo, DejaVu fonts are prepended to each serif/sans-serif/monospace list, so they will be used for Latin fonts, basic or extended. Only when it fails to find the glyph in the DejaVu series (i.e. the Chinese/Japanese fonts) will it start looking up the other fonts.

Okay so what is the issue here? Do you want this voodoo to be enabled by default? Well, seeing it's supposed to match "lang=ja" only, that can be considered.

Revision history for this message
areteichi (areteichi) wrote :

Japanese Team makes the Japanese characters look precisely the way I have them configured above. The problem is that if I use their release, the English characters look different and I don't like that. My .font.conf file takes both of the settings and makes the fonts appear as they should.

By the way, I have been using Takao fonts and my latest configuration file is set for that.

Revision history for this message
Ahmad Syukri Abdollah (syockit) wrote :

areteichi,
It's probably due to DejaVu Sans being prepended at the top of the prepend list. Maybe that can be fixed. IMO it is not needed there; and maybe prepend shouldn't be used.

Revision history for this message
areteichi (areteichi) wrote :

> Ahmad Syukri

Well, as you can see from the long duration of this bug, I had the same issue even before the Ubuntu fonts were included in Ubuntu, when DejaVu fonts were still used as the default. So while I don't know the technical details of this, I'm not exactly sure if it is just a matter of priorities. I remember I had some problems enabling font rendering and anti-aliasing for the Japanese characters unless I use the custom setting through .fonts.conf.

I mean if you can fix this problem simply by taking out the DejaVu Sans from the list, then I'd be more than happy. I'm just not sure if that is all that is required.

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.