HomeBanner

XFree86 Fonts Related Problems

Fonts FAQ

1. How does one add Truetype fonts ?
2. I run /sbin/init.d/SuSEconfig.fonts and that doesn't output any errors (should it?).
3. How can I fix AntiAliasing problems with LCD monitors?
1.

How does one add Truetype fonts ?

  1. Change to where the fonts are.

        cd /usr/X11R6/lib/X11/fonts/truetype
    	  
  2. Copy your truetype fonts here.

  3. Determine if there are any files been created for the scaling of the ttf's.

            ls -l fonts.s*
    	  
  4. Remove all these files.

            rm fonts.s*
    	  
  5. Create a new font scale file.

            ttmkfdir | sed s/^[0-9]*// > fonts.scale.myfonts
    	  
  6. Now run SuSEconfig.fonts

    	  /sbin/conf.d/SuSEconfig.fonts
    	  
  7. Run xset to reread the font paths

            xset fp rehash
    	  
  8. You should be able to see the fonts with

    	xfontsel
    	  

Note

2.

I run /sbin/init.d/SuSEconfig.fonts and that doesn't output any errors (should it?).

/sbin/conf.d/SuSEconfig.fonts didn't update fonts.dir. Example

    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype# echo 0 > fonts.dir
    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype#
    /sbin/conf.d/SuSEconfig.fonts
    Updating fonts.scale for truetype
    Updating fonts.scale for Type1
    Updating fonts.scale for Speedo
    Updating fonts.scale for CID
    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype# cat fonts.dir
    0
      

nothing happened. /sbin/conf.d/SuSEconfig.fonts checks the timestamp of /usr/X11R6/lib/X11/fonts/truetype and compares it with the timestamp of /var/adm/SuSEconfig/lastrun.SuSEconfig.fonts to find out whether it needs to update fonts.dir. But the timestamp of the /usr/X11R6/lib/X11/fonts/truetype didn't change after I did echo 0 > fonts.dir, therefore SuSEconfig.fonts didn't do any work. It's possible to force it by removing fonts.dir:

    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype# rm fonts.dir
    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype#
    /sbin/conf.d/SuSEconfig.fonts
    Updating fonts.scale for truetype
    Updating fonts.scale for Type1
    Updating fonts.scale for Speedo
    Updating fonts.scale for CID
    Updating X11 font directory truetype...
    create XftCache files ...
      

Now we see the message "Updating X11 font directory truetype..." and now fonts.dir has the same contents as fonts.scale:

    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype# head -n 5 fonts.dir
    694
    luximr.ttf -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-1
    luximr.ttf -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-2
    luximr.ttf -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-3
    luximr.ttf -b&h-Luxi Mono-medium-r-normal--0-0-0-0-m-0-iso8859-4
    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype#
      

You can achieve the same effect by touching /usr/X11R6/lib/X11/fonts/truetype:

    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype# touch
    /usr/X11R6/lib/X11/fonts/truetype
    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype#
    /sbin/conf.d/SuSEconfig.fonts
    Updating fonts.scale for truetype
    Updating fonts.scale for Type1
    Updating fonts.scale for Speedo
    Updating fonts.scale for CID
    Updating X11 font directory truetype...
    create XftCache files ...
    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype#
      

Or, if you want to recreate all fonts.dir files in all directories, remove the global time stamp:

    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype# rm
    /var/adm/SuSEconfig/lastrun.SuSEconfig.fonts
    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype#
    /sbin/conf.d/SuSEconfig.fonts        Updating fonts.scale for truetype
    Updating fonts.scale for Type1
    Updating fonts.scale for Speedo
    Updating fonts.scale for CID
    Updating X11 font directory 75dpi...
    Updating X11 font directory CID...
    Updating X11 font directory Speedo...
    Updating X11 font directory TTF...
    Updating X11 font directory Type1...
    Updating X11 font directory baekmuk...
    Updating X11 font directory encodings...
    Updating X11 font directory encodings/large...
    Updating X11 font directory japanese...
    Updating X11 font directory local...
    Updating X11 font directory misc...
    Updating X11 font directory truetype...
    Updating X11 font directory ucs...
    Updating X11 font directory ucs/misc...
    Updating X11 font directory uni...
    Updating X11 font directory util...
    create XftCache files ...
    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype#
      

When I go to run "xset fp rehash" as my user I get the following output:

  xset fp rehash
 X Error of failed request:  86
   Major opcode of failed request:  51 (X_SetFontPath)
   Serial number of failed request:  8
   Current serial number in output stream:  10
	

What does this actually mean?

Broken fonts.dir or fonts.dir refers to fonts which don't exist or fonts listed in fonts.dir are broken themselves. For example:

    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype# xset fp rehash
	

OK, no error (This root user has access to the display because I became root using the sux script). Now write nonsense to fonts.dir:

    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype# echo nonsense > fonts.dir
	

And we get this error message:

    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype# xset fp rehash
    X Error of failed request:  86
      Major opcode of failed request:  51 (X_SetFontPath)
      Serial number of failed request:  8
      Current serial number in output stream:  10
    root@nozomi:/usr/X11R6/lib/X11/fonts/truetype#
	
3.

How can I fix AntiAliasing problems with LCD monitors?

Graham  Smith

Basically you have to add

match edit rgba = bgr;
      

to the ~/.xftconfig file. If this file does't exist just create it and add the above line to it.

Note

XFree86 Font De-uglification HOWTO Section 4.1.3.3 Item 8 but recommend reading all the items in the above section as it covers many fixes that can be done to make the better on the eyes. http://www.tldp.org/HOWTO/mini/FDU/index.html


Updated: Tue, 03 Feb 2004
Valid CSS!Valid HTML 4.01!