Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 18666 - TrueType font handling problems in KDE
Summary: TrueType font handling problems in KDE
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-02 18:13 UTC by Nicolas Laplante
Modified: 2004-03-16 05:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Laplante 2003-04-02 18:13:44 UTC
I am using: 
 
xfree-4.3.0-r1 
fontconfig-2.1-r1 
xft-2.0.1-r1 
kde-3.1.1 
 
In /etc/XF86Config, the only FontPath directive contains this: 
 
FontPath	"unix/localhost:-1" 
 
as I am using the X font server. 
 
I copied the fonts from Windows XP (*.ttf) to /usr/X11R6/lib/X11/fonts/truetype 
(overwriting the ones Gentoo installs) to get all the TrueType fonts available on my 
machine.  
 
The problem is, with some fonts (eg. Tahoma), the space between the letters is really 
huge, l   i    k   e      t    h    i    s . 
 
Also, I think that xfs has a broken configuration, where some monospace fonts (artwiz) 
are replaced with Luxi Sans in KDE. 
 
 

Reproducible: Always
Steps to Reproduce:
1. Install X and KDE 
2. Copy *.ttf from my Windows XP font directory to /usr/X11R6/lib/X11/fonts/truetype 
3. Use fc-cache (or whatever is used in /etc/init.d/xfs) to index the new fonts and 
restart the X font server 
 
Actual Results:  
Weird font rendering in KDE. Gnome doesn't seem to have this problem. 

Expected Results:  
Make the fonts look right. 

twix@holyshit twix $ emerge info 
Portage 2.0.47-r10 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r4) 
================================================================= 
System uname: 2.4.20-gaming-r1 i686 AMD Athlon(tm) XP 2100+ 
GENTOO_MIRRORS="ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo 
ftp://csociety-ftp.ecn.purdue.edu/pub/gentoo/ 
http://csociety-ftp.ecn.purdue.edu/pub/gentoo/ http://gentoo.linux.no/ 
ftp://gentoo.linux.no/pub/gentoo/" 
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config 
/usr/kde/3/share/config 
/usr/X11R6/lib/X11/xkb:/usr/kde/3.1/share/config:/usr/share/config" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" 
PORTDIR="/usr/portage" 
DISTDIR="/usr/portage/distfiles" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR_OVERLAY="/home/portage" 
USE="x86 oss apm avi crypt encode gif jpeg libg++ mikmod mpeg ncurses nls pdflib 
png quicktime spell truetype xml2 xmms xv zlib gdbm berkdb slang readline arts tetex 
svga tcltk java sdl gpm tcpd pam libwww ssl perl python esd imlib oggvorbis motif 
opengl mozilla mmx 3dnow sse alsa cdr dvd qt kde X cups mysql -gtk -gnome tiff fbcon" 
COMPILER="gcc3" 
CHOST="i686-pc-linux-gnu" 
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer" 
CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer" 
ACCEPT_KEYWORDS="x86" 
MAKEOPTS="-j2" 
AUTOCLEAN="yes" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
FEATURES="ccache sandbox buildpkg" 
 
PS: Using KDE's font installer to install the fonts from 
/usr/X11R6/lib/X11/fonts/truetype to my home directory partially fixed the problem, but 
monospace fonts still aren't rendered correctly.
Comment 1 Francisco León 2003-04-07 09:25:14 UTC
I too am experiencing this, lots of font look the same with the spacing problem in kde. Actually this has been going on forever i think
Comment 2 Paul de Vrieze (RETIRED) gentoo-dev 2003-04-21 16:07:57 UTC
You could start with (re)merging (in this order)
>=freetype-2.1.3
fontconfig (newest)
xft or xfree-4.3.0-r2
qt (remerging qt is essential)

If you allready did this. Are you sure all font files are readable. Also run "fc-cache -f" to update the fonts cache.
Comment 3 Christian Apolloni 2003-04-22 11:13:06 UTC
I solved the problem leaving only:

<dir>/usr/X11R6/lib/X11/fonts</dir>
<dir>/usr/share/fonts</dir>
<dir>~/.fonts</dir>

In '/etc/fonts/fonts.conf' and refreshing the font cache, but at the cost of antialias I think.

Of course I don't like this way so much (I won't even call it "solution"...;).
Comment 4 Paul de Vrieze (RETIRED) gentoo-dev 2003-04-22 12:46:22 UTC
Could you tell me what was in fonts.conf before? The new font support is a bit in
a state of flux, so things can break. There are also many broken font files out there.
Comment 5 Nicolas Laplante 2003-04-22 14:31:54 UTC
============================================ 
My /etc/fonts/fonts.conf: 
============================================ 
 
<?xml version="1.0"?> 
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> 
<!-- /etc/fonts.conf file to configure system font access --> 
<fontconfig> 
 
<!-- 
        The intent of this standard configuration file is to be adequate for 
        most environments.  If you have a reasonably normal environment and 
        have found problems with this configuration, they are probably 
        things that others will also want fixed.  Please send any suggested 
        changes to fonts@xfree86.org so that future releases can include 
        such changes. 
 
        Note that the normal 'make install' procedure for XFree86 is to 
        replace any existing fonts.conf file with the new version.  Place 
        any local customizations in local.conf which this file references. 
 
        Keith Packard 
--> 
 
 
        <dir>/usr/share/fonts</dir> 
        <dir>/usr/X11R6/lib/X11/fonts</dir> 
        <dir>~/.fonts</dir> 
 
<!-- 
  Enable sub-pixel rendering 
        <match target="font"> 
                <test qual="all" name="rgba"> 
                        <const>unknown</const> 
                </test> 
                <edit name="rgba" mode="assign"><const>rgb</const></edit> 
        </match> 
--> 
 
<!-- 
  Accept deprecated 'mono' alias, replacing it with 'monospace' 
--> 
        <match target="pattern"> 
                <test qual="any" name="family"> 
                        <string>mono</string> 
                </test> 
                <edit name="family" mode="assign"> 
                        <string>monospace</string> 
                </edit> 
        </match> 
 
<!-- 
  Accept alternate 'sans serif' spelling, replacing it with 'sans-serif' 
--> 
        <match target="pattern"> 
                <test qual="any" name="family"> 
                        <string>sans serif</string> 
                </test> 
                <edit name="family" mode="assign"> 
                        <string>sans-serif</string> 
                </edit> 
        </match> 
 
<!-- 
  Accept deprecated 'sans' alias, replacing it with 'sans-serif' 
--> 
        <match target="pattern"> 
                <test qual="any" name="family"> 
                        <string>sans</string> 
                </test> 
                <edit name="family" mode="assign"> 
                        <string>sans-serif</string> 
                </edit> 
        </match> 
 
<!-- 
  Mark common families with their generics so we'll get 
  something reasonable 
--> 
 
<!-- 
  Serif faces 
 --> 
        <alias> 
                <family>Times</family> 
                <family>Times New Roman</family> 
                <family>Nimbus Roman No9 L</family> 
                <family>Luxi Serif</family> 
                <family>Kochi Mincho</family> 
                <family>AR PL SungtiL GB</family> 
                <family>AR PL Mingti2L Big5</family> 
                <family>Baekmuk Batang</family> 
                <default><family>serif</family></default> 
        </alias> 
<!-- 
  Sans-serif faces 
 --> 
        <alias> 
                <family>Helvetica</family> 
                <family>Arial</family> 
                <family>Verdana</family> 
                <family>Nimbus Sans L</family> 
                <family>Luxi Sans</family> 
                <family>Kochi Gothic</family> 
                <family>AR PL KaitiM GB</family> 
                <family>AR PL KaitiM Big5</family> 
                <family>Baekmuk Dotum</family> 
                <family>SimSun</family> 
                <default><family>sans-serif</family></default> 
        </alias> 
<!-- 
  Monospace faces 
 --> 
        <alias> 
                <family>Courier</family> 
                <family>Courier New</family> 
                <family>Andale Mono</family> 
                <family>Luxi Mono</family> 
                <family>Nimbus Mono L</family> 
                <family>NSimSun</family> 
                <default><family>monospace</family></default> 
        </alias> 
<!-- 
  If the font still has no generic name, add sans-serif 
 --> 
        <match target="pattern"> 
                <test qual="all" name="family" compare="not_eq"> 
                        <string>sans-serif</string> 
                </test> 
                <test qual="all" name="family" compare="not_eq"> 
                        <string>serif</string> 
                </test> 
                <test qual="all" name="family" compare="not_eq"> 
                        <string>monospace</string> 
                </test> 
                <edit name="family" mode="append_last"> 
                        <string>sans-serif</string> 
                </edit> 
        </match> 
 
<!-- 
  Some Asian fonts misadvertise themselves as monospaced when 
  in fact they are dual-spaced (half and full).  This makes 
  FreeType very confused as it forces all widths to match. 
  Undo this magic by disabling the width forcing code --> 
        <match target="font"> 
                <test name="family"><string>GulimChe</string></test> 
                <edit name="globaladvance"><bool>false</bool></edit> 
        </match> 
 
        <match target="font"> 
                <test name="family"><string>DotumChe</string></test> 
                <edit name="globaladvance"><bool>false</bool></edit> 
        </match> 
 
        <match target="font"> 
                <test name="family"><string>BatangChe</string></test> 
                <edit name="globaladvance"><bool>false</bool></edit> 
        </match> 
 
        <match target="font"> 
                <test name="family"><string>GungsuhChe</string></test> 
                <edit name="globaladvance"><bool>false</bool></edit> 
        </match> 
 
<!-- 
  Load per-user customization file 
--> 
        <include ignore_missing="yes">~/.fonts.conf</include> 
 
<!-- 
  Load local system customization file 
--> 
        <include ignore_missing="yes">local.conf</include> 
 
<!-- 
  Alias well known font names to available TrueType fonts 
--> 
        <alias> 
                <family>Times</family> 
                <accept><family>Times New Roman</family></accept> 
        </alias> 
        <alias> 
                <family>Helvetica</family> 
                <accept><family>Verdana</family></accept> 
        </alias> 
        <alias> 
                <family>Arial</family> 
                <accept><family>Verdana</family></accept> 
        </alias> 
        <alias> 
                <family>Courier</family> 
                <accept><family>Courier New</family></accept> 
        </alias> 
 
<!-- 
  Provide required aliases for standard names 
--> 
        <alias> 
                <family>serif</family> 
                <prefer> 
                        <family>Nimbus Roman No9 L</family> 
                        <family>Luxi Serif</family> 
                        <family>Kochi Mincho</family> 
                        <family>ZYSong18030</family> 
                        <family>AR PL SungtiL GB</family> 
                        <family>AR PL Mingti2L Big5</family> 
                        <family>Baekmuk Batang</family> 
                        <family>Times New Roman</family> 
                        <family>Times</family> 
                </prefer> 
        </alias> 
        <alias> 
                <family>sans-serif</family> 
                <prefer> 
                        <family>Luxi Sans</family> 
                        <family>Nimbus Sans L</family> 
                        <family>Helvetica</family> 
                        <family>Kochi Gothic</family> 
                        <family>ZYSong18030</family> 
                        <family>AR PL SungtiL GB</family> 
                        <family>AR PL Mingti2L Big5</family> 
                        <family>Baekmuk Gulim</family> 
                        <family>Verdana</family> 
                        <family>Arial</family> 
                        <family>SimSun</family> 
                </prefer> 
        </alias> 
        <alias> 
                <family>monospace</family> 
                <prefer> 
                        <family>Luxi Mono</family> 
                        <family>Nimbus Mono L</family> 
                        <family>Kochi Gothic</family> 
                        <family>ZYSong18030</family> 
                        <family>AR PL SungtiL GB</family> 
                        <family>AR PL Mingti2L Big5</family> 
                        <family>Baekmuk Gulim</family> 
                        <family>Andale Mono</family> 
                        <family>Courier New</family> 
                </prefer> 
        </alias> 
 
<!-- 
 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> 
 
<!-- 
 Artificial oblique for fonts without an italic or oblique version 
 --> 
 
        <match target="font"> 
                <!-- check to see if the font is roman --> 
                <test name="slant"> 
                        <const>roman</const> 
                </test> 
                <!-- check to see if the pattern requested non-roman --> 
                <test target="pattern" name="slant" compare="not_eq"> 
                        <const>roman</const> 
                </test> 
                <!-- multiply the matrix to slant the font --> 
                <edit name="matrix" mode="assign"> 
                        <times> 
                                <name>matrix</name> 
                                <matrix><double>1</double><double>.2</double> 
                                        <double>0</double><double>1</double> 
                                </matrix> 
                        </times> 
                </edit> 
                <!-- pretend the font is oblique now --> 
                <edit name="slant" mode="assign"> 
                        <const>oblique</const> 
                </edit> 
        </match> 
 
        <config> 
<!-- 
  These are the default Unicode chars that are expected to be blank 
  in fonts.  All other blank chars are assumed to be broken and 
  won't appear in the resulting charsets 
 --> 
                <blank> 
                        <int>0x0020</int>       <!-- SPACE --> 
                        <int>0x00a0</int>       <!-- NO-BREAK SPACE --> 
                        <int>0x00ad</int>       <!-- SOFT HYPHEN --> 
                        <int>0x115f</int>       <!-- HANGUL CHOSEONG FILLER --> 
                        <int>0x1160</int>       <!-- HANGUL JUNGSEONG FILLER --> 
                        <int>0x1680</int>       <!-- OGHAM SPACE MARK --> 
                        <int>0x2000</int>       <!-- EN QUAD --> 
                        <int>0x2001</int>       <!-- EM QUAD --> 
                        <int>0x2002</int>       <!-- EN SPACE --> 
                        <int>0x2003</int>       <!-- EM SPACE --> 
                        <int>0x2004</int>       <!-- THREE-PER-EM SPACE --> 
                        <int>0x2005</int>       <!-- FOUR-PER-EM SPACE --> 
                        <int>0x2006</int>       <!-- SIX-PER-EM SPACE --> 
                        <int>0x2007</int>       <!-- FIGURE SPACE --> 
                        <int>0x2008</int>       <!-- PUNCTUATION SPACE --> 
                        <int>0x2009</int>       <!-- THIN SPACE --> 
                        <int>0x200a</int>       <!-- HAIR SPACE --> 
                        <int>0x200b</int>       <!-- ZERO WIDTH SPACE --> 
                        <int>0x200c</int>       <!-- ZERO WIDTH NON-JOINER --> 
                        <int>0x200d</int>       <!-- ZERO WIDTH JOINER --> 
                        <int>0x200e</int>       <!-- LEFT-TO-RIGHT MARK --> 
                        <int>0x200f</int>       <!-- RIGHT-TO-LEFT MARK --> 
                        <int>0x2028</int>       <!-- LINE SEPARATOR --> 
                        <int>0x2029</int>       <!-- PARAGRAPH SEPARATOR --> 
                        <int>0x202a</int>       <!-- LEFT-TO-RIGHT EMBEDDING --> 
                        <int>0x202b</int>       <!-- RIGHT-TO-LEFT EMBEDDING --> 
                        <int>0x202c</int>       <!-- POP DIRECTIONAL FORMATTING --> 
                        <int>0x202d</int>       <!-- LEFT-TO-RIGHT OVERRIDE --> 
                        <int>0x202e</int>       <!-- RIGHT-TO-LEFT OVERRIDE --> 
                        <int>0x202f</int>       <!-- NARROW NO-BREAK SPACE --> 
                        <int>0x205f</int>       <!-- MEDIUM MATHEMATICAL SPACE --> 
                        <int>0x2060</int>       <!-- WORD JOINER --> 
                        <int>0x2061</int>       <!-- FUNCTION APPLICATION --> 
                        <int>0x2062</int>       <!-- INVISIBLE TIMES --> 
                        <int>0x2063</int>       <!-- INVISIBLE SEPARATOR --> 
                        <int>0x206A</int>       <!-- INHIBIT SYMMETRIC SWAPPING --> 
                        <int>0x206B</int>       <!-- ACTIVATE SYMMETRIC SWAPPING 
--> 
                        <int>0x206C</int>       <!-- INHIBIT ARABIC FORM SHAPING --> 
                        <int>0x206D</int>       <!-- ACTIVATE ARABIC FORM SHAPING 
--> 
                        <int>0x206E</int>       <!-- NATIONAL DIGIT SHAPES --> 
                        <int>0x206F</int>       <!-- NOMINAL DIGIT SHAPES --> 
                        <int>0x3000</int>       <!-- IDEOGRAPHIC SPACE --> 
                        <int>0x3164</int>       <!-- HANGUL FILLER --> 
                        <int>0xfeff</int>       <!-- ZERO WIDTH NO-BREAK SPACE --> 
                        <int>0xffa0</int>       <!-- HALFWIDTH HANGUL FILLER --> 
                        <int>0xfff9</int>       <!-- INTERLINEAR ANNOTATION ANCHOR 
--> 
                        <int>0xfffa</int>       <!-- INTERLINEAR ANNOTATION 
SEPARATOR --> 
                        <int>0xfffa</int>       <!-- INTERLINEAR ANNOTATION 
TERMINATOR --> 
                </blank> 
<!-- 
  Rescan configuration every 30 seconds when FcFontSetList is called 
 --> 
                <rescan> 
                        <int>30</int> 
                </rescan> 
        </config> 
 
</fontconfig> 
 
=========================================== 
 
I just updated X to 4.3.0-r2 and /etc/fonts/fonts.conf didn't change since the 
last release (no etc-update needed). 
Comment 6 Seth Chandler 2003-04-22 14:33:22 UTC
fonts.conf comes from fontconfig not xfree 
Comment 7 Nicolas Laplante 2003-04-22 14:40:48 UTC
Oh. But I updated all the packages stated on this thread and 
/etc/fonts/fonts.conf wasn't one of the files which needed an update. 
Comment 8 Paul de Vrieze (RETIRED) gentoo-dev 2003-04-22 14:43:53 UTC
fonts.conf autoupdates you will need to put your changes in /etc/fonts/local.conf
Comment 9 Heribert Slama 2003-07-20 04:35:59 UTC
emerge rsync & -u system upgraded XFree86 to v4.3.0-r2. 
 
After that KDE system fonts (Helvetica) were broken: no glyphs, but very long 
thin bars or very wide empty space; most control elements shifted out of sight; 
grossly oversized windows. 
 
It is the same problem, because Paul's cure (comment#2) worked:-) 
 
Considering that I already had installed 
freetype-2.1.4 
fontconfig-2.2.0.r2 
xft-2.0.1.r2 
xfree-4.3.0-r2 
I simply re-emerged qt-3.1.2-r3 although it was already installed. 
 
This helped! I'm writing this comment with Konqueror;-) Thank you, Paul. 
 
I'm just wondering, what funny kind of dependency this is, and why emerge didn't 
detect it. Could it be that (a) there is static binding between qt and xft; (b) some 
pre-/post-installation routines evaluate current system state thus producing 
different code (+config files?) for qt? And why is it still a problem after 3 
months? <oops>. 
Comment 10 Paul de Vrieze (RETIRED) gentoo-dev 2003-07-20 06:07:44 UTC
Well there were some changes in the fontconfig library. Those changes in some way affect qt, while dynamic linking still works. The problem thus is that the old and new fontconfig are not compatible. Currently there is no support yet for the mandatory rebuilding or dependant packages, so there is unfortunately no way in which this can be finally resolved.
Comment 11 Caleb Tennis (RETIRED) gentoo-dev 2004-03-16 05:12:17 UTC
This shouldn't be a problem anymore with latest KDE and Qt combo.