Bug 41169 - Patch for X font server rc script
Patch for X font server rc script
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: XFree86 (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Mike A. Harris
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-05-17 19:21 EDT by Hao Li
Modified: 2007-04-18 12:33 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-05-19 14:42:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Here is the patch again. (1.01 KB, patch)
2001-05-17 19:23 EDT, Hao Li
no flags Details | Diff

  None (edit)
Description Hao Li 2001-05-17 19:21:15 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
too ...

Hence the patch:

--- xfs.orig    Fri Mar 30 18:51:56 2001
+++ xfs Thu May 17 16:12:16 2001
@@ -32,7 +32,7 @@
                        fi
                        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
                                         mkfontdir -e
/usr/X11R6/lib/X11/fonts/encodings \
@@ -40,7 +40,7 @@
                                         chmod a+r fonts.scale
                                         chmod a+r fonts.dir
                                 fi
-                               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...
 
                                         mkfontdir -e
/usr/X11R6/lib/X11/fonts/encodings \


How reproducible:
Always

Steps to Reproduce:
Look at the patch supplied ...

Additional info:
Comment 1 Hao Li 2001-05-17 19:23:58 EDT
Created attachment 18834 [details]
Here is the patch again.
Comment 2 Mike A. Harris 2001-05-19 04:50:07 EDT
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
cat 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.

Thanks.

Comment 3 Hao Li 2001-05-19 14:42:33 EDT
#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:
	simsun.ttc -misc-SimSun-medium-r-normal--0-0-0-0-p-0-ascii-0
while according to the webpage above I should get:
	:1:simsun.ttc -misc-SimSun-medium-r-normal--0-0-0-0-p-0-ascii-0
but this is another issue than what we are are talking about here.
Comment 4 Mike A. Harris 2001-08-13 19:22:44 EDT
Initial problem reported is now fixed in XFree86 4.1.0-0.9.12 internally,
will be in rawhide shortly.

Note You need to log in before you can comment on or make changes to this bug.