Bug 41169 - Patch for X font server rc script
Summary: Patch for X font server rc script
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: XFree86   
(Show other bugs)
Version: 7.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Mike A. Harris
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2001-05-17 23:21 UTC by Hao Li
Modified: 2007-04-18 16:33 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-05-19 18:42:37 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

Description Hao Li 2001-05-17 23:21:15 UTC
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 @@
                        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
-                               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:

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

Additional info:

Comment 1 Hao Li 2001-05-17 23:23:58 UTC
Created attachment 18834 [details]
Here is the patch again.

Comment 2 Mike A. Harris 2001-05-19 08:50:07 UTC
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.


Comment 3 Hao Li 2001-05-19 18:42:33 UTC
#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 23:22:44 UTC
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.