Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 12521

Summary: fontconfig do hint Chinese fonts well (/etc/fonts/fonts.conf error)
Product: Gentoo Linux Reporter: Yi-Shin Li <ysli>
Component: [OLD] LibraryAssignee: Martin Schlemmer (RETIRED) <azarah>
Status: VERIFIED TEST-REQUEST    
Severity: major CC: bug-wranglers, nakano, seo, ysli
Priority: Normal    
Version: 1.4_rc1   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Yi-Shin Li 2002-12-21 08:25:28 UTC
versions:
fontconfig-2.1
freetype-2.1.3-r2
xft-2.0.1
mozilla-1.2.1-r3

My mozilla(w/ xft support) could hardly display 
Chinese truetype fonts when I went to tw.yahoo.com.
My other gtk application, gaim, was not able to 
render Chinese TTFs well neither. However, the
xfd did display them without problem. Those Chinese 
fonts, kaiu.ttf and mingliu.ttc, are copied from Win2K.

I finally figured out that is because my fontconfig-2.1
has disabled the CJK fonts hinting in /etc/fonts/fonts.conf.
By enabling the Chinese(zh) TTF hinting, both my mozilla
and gaim render the TTF beautifully. I do not know if Koren
or Japan TTFs have the same problem.

from /etc/fonts/fonts.conf:
	<match target="font">
		<test name="lang" compare="contains">
			<string>zh</string>
		</test>
		<edit name="hinting" mode="assign">
			<bool>true</bool>
		</edit>
	</match>

Regards,
Yi-Shin
Comment 1 Seemant Kulleen (RETIRED) gentoo-dev 2002-12-21 15:53:48 UTC
Nakano, can you confirm this for Japanese fonts please?
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-21 16:11:54 UTC
<!-- 
 We can't hint CJK fonts well, so turn off hinting for CJK fonts.
 -->

        <match target="font">
                <test name="lang" compare="contains">
                        <string>ja</string>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>false</bool>
                </edit>
        </match>
        <match target="font">
                <test name="lang" compare="contains">
                        <string>ko</string>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>false</bool>
                </edit>
        </match>
        <match target="font">
                <test name="lang" compare="contains">
                        <string>zh</string>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>false</bool>
                </edit>
        </match>

--------------

Looks like Keith and co turned it off by default ...
Comment 3 Seemant Kulleen (RETIRED) gentoo-dev 2002-12-22 04:57:40 UTC
Seo, can you test Korean fonts please?
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-22 05:11:42 UTC
Btw, that page display fine here without editing fonts.conf ...
Comment 5 Jungmin Seo (RETIRED) gentoo-dev 2002-12-22 05:46:51 UTC
my korean ttf fonts work well without enabling the hinting feature, and your 
chinese fonts seem to have the correct hinting information with them, which is 
why they are better with enabling it.
Comment 6 Yi-Shin Li 2002-12-22 22:40:59 UTC
>Btw, that page display fine here without editing fonts.conf ...
maybe that is because we have different Chinese TTF configuration.
What is your font configuration? 

In my mozilla, the "Traditional Chinese Font" is "PMingLiU", 
which is copied from MSWin2K(mingliu.ttc). 
The followings are the screenshots that took from mozilla:

tw.yahoo.com with "zh" hinting (200% text room):
http://cottonclub.ee.columbia.edu/~ysli/hint-zh-tw.yahoo.com.png

tw.yahoo.com without "zh" hinting (200% text room):
http://cottonclub.ee.columbia.edu/~ysli/nohint-zh-tw.yahoo.com.png

the Chinese Font configuration:
http://cottonclub.ee.columbia.edu/~ysli/mozilla-font-conf.png
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-22 22:56:55 UTC
Didnt specify specific chinese fonts .. just let it use site specified ones
Comment 8 Seemant Kulleen (RETIRED) gentoo-dev 2003-04-20 04:39:43 UTC
still an issue?
Comment 9 Heinrich Wendel (RETIRED) gentoo-dev 2003-11-24 03:09:53 UTC
please test with latest fontconfig
Comment 10 Yi-Shin Li 2003-11-24 14:59:19 UTC
fontconfig-2.2.1
mozilla-1.5
The Chinese Font Problem has been solved.

Portage 2.0.49-r15 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.22)
=================================================================
System uname: 2.4.22 i686 AMD Duron(tm) Processor
Gentoo Base System version 1.4.3.12
distcc 2.11.2 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabd]
ccache version 2.3 [enabled]
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-mcpu=athlon -O2 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/sha/config /var/bind /usr/X11R6/lib/X11/xkb /opt/tomcat/conf /usr/kde/3.1/share/cfig /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /r/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-mcpu=athlon -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="ftp://sunsite.ualberta.ca/pub/unix/Linux/gentoo/ http://gentooregonstate.edu/ http://distro.ibiblio.org/pub/Linux/distributions/gentoo http:csociety-ftp.ecn.purdue.edu/pub/gentoo/"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 apm foomaticdb libg++ mad mikmod pdflib xmms xv zlib gtkhtml gdbm berb slang readline tetex svga guile sdl gpm tcpd pam python imlib qt motif snmp r -sse 3dnow mmx kde gnome alsa bonobo -cups lprng mozilla truetype dvd jpeg g avi mpeg encode quicktime opengl directfb esd nls nas arts perl tcltk java crt xfs ssl mozsvg mozcalendar mozinterfaceinfo mozp3p mozxmlterm moznocompose o oggvorbis ncurses X libwww png gtk gtk2 lcms tiff xml2 -ldap mysql imap maild sasl postgres ofx hbci doc spell cjk"
Comment 11 Thomas Bettler 2005-10-31 17:27:08 UTC
You might close this bug, it's solved now!