Greg Macek
I've tried this and a lot of other things on my machine (7.3, XF4.2) to get my TTF working again, but no avail. Following the first part of the instructions below gets me a fonts.scale file that is around 26K in size, listing all the fonts in the truetype directory. That's fine. However, fonts.dir is still set to 2 bytes, only containing a "0". Not sure why this is. 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 saw 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#
--
Mike Fabian