Red Hat Bugzilla – Bug 41169
Patch for X font server rc script
Last modified: 2007-04-18 12:33:18 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.1 i686; Nav)
Description of problem:
The commands to search for TrueType fonts have at least two problems:
1. "ls" can show multiple files per line. Using "egrep -v" on such results
obviously can throw away some files that shouldn't have been excluded.
2. TrueType fonts can end with either ttf or ttc.
The huge indenting which make lines longer than 80 chars are very annoying
Hence the patch:
--- xfs.orig Fri Mar 30 18:51:56 2001
+++ xfs Thu May 17 16:12:16 2001
@@ -32,7 +32,7 @@
if [ "$NEEDED" = "yes" ]; then
rm -f fonts.dir &>/dev/null
- if ls | grep \.ttf$ &>/dev/null; then
+ if ls -1 | grep \.tt[fc]$ &>/dev/null; then
# TrueType fonts found...
ttmkfdir . >fonts.scale
@@ -40,7 +40,7 @@
chmod a+r fonts.scale
chmod a+r fonts.dir
- if [ "x`ls |egrep --ignore-case -v
'\.ttf$|^fonts\.|^encodings\.'`" != "x" ]; then
+ if [ "x`ls -1 |egrep --ignore-case -v
'\.tt[fc]$|^fonts\.|^encodings\.'`" != "x" ]; then
# This directory contains fonts
that are not TrueType...
Steps to Reproduce:
Look at the patch supplied ...
Created attachment 18834 [details]
Here is the patch again.
If ls is used with output redirection of any type, it outputs one
column, not multiple. To test this try this:
ls | less
ls > junk.txt
You'll see that there is one column, so problem #1 is no problem. ;o)
#2 - I have never seen truetype fonts named .ttc, so I am hesitant to make
this change. If any change should be made it would be best to use file(1)
to nail all valid files. Doing such however is not super high priority, but
if I can't do it right away, I will consider the .ttc thing if you can
point out to me where the files come from, why the distinction with .ttc
instead of .ttf, and that the files are really working truetype fonts.
My reason for being so picky with this stuff is that there are lots of open
ttf font problems and I'm not anxious to risk making more.
#3 - I agree completely about the horrible indenting problem. When I get
a chance I'll be redoing that script to use 2-4 spaces or so instead of
what looks like tab's.
#1: Agreed. I mis-alarmed :(
#2: See http://www.xfree86.org/4.0.3/fonts5.html. I've seen some CJK fonts
ending with ttc under Win2k (but not WinNT). However I noticed that ttmkfdir
doesn't seem to generate the font.dir lines correctly for ttc files, i.e., I am
getting things like:
while according to the webpage above I should get:
but this is another issue than what we are are talking about here.
Initial problem reported is now fixed in XFree86 4.1.0-0.9.12 internally,
will be in rawhide shortly.