Bug 58446 - ttmkfdir hates when encodings.dir is present
ttmkfdir hates when encodings.dir is present
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: XFree86 (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Mike A. Harris
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-01-16 16:52 EST by Alexei Podtelezhnikov
Modified: 2007-04-18 12:39 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-04-03 09:12:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alexei Podtelezhnikov 2002-01-16 16:52:55 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7) Gecko/20011226

Description of problem:
ttmkfdir is extremely slow and prone to produce bad output if encodings.dir is
present. Namely, it may take seconds to run ttmkfdir on *ANY* TrueType dir, if
encodings.dir is present; while without this file, ttmkfdir is flawless and
fast. The bad output, which also depends on encodings.dir presence, was only
observed with japanese fonts (see below).

Version-Release number of selected component (if applicable): tested with
freetype-2.0.3-7 and the newest kochi-mincho-20020108.  


How reproducible:
Always


Steps to Reproduce:
Follow my log. Note changes in the ttmkfdir output. Note migration of the
mistake into fonts.dir later.

[user@localhost fonts]$ ls -l
total 5820
-rw-r--r--    1 user       users      5925220 Jan  7 17:32 kochi-mincho.ttf
-rw-r--r--    1 user       users        17318 Jan 16 12:06 kochi-mincho.tti
[user@localhost fonts]$ ttmkfdir .    <<<<< VERY FAST >>>>>>
13
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-ascii-0
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-fcd8859-15
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-1
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-10
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-15
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-2
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-3
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-4
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-5
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-7
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-9
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-koi8-r
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-koi8-ru
[user@localhost fonts]$ ttmkfdir . >fonts.scale
[user@localhost fonts]$ mkfontdir -e /usr/X11R6/lib/X11/fonts/encodings -e
/usr/X11R6/lib/X11/fonts/encodings/large .
[user@localhost fonts]$ ls -l
total 5832
-rw-r--r--    1 user       users         2877 Jan 16 12:45 encodings.dir
-rw-r--r--    1 user       users          974 Jan 16 12:45 fonts.dir
-rw-r--r--    1 user       users          974 Jan 16 12:45 fonts.scale
-rw-r--r--    1 user       users      5925220 Jan  7 17:32 kochi-mincho.ttf
-rw-r--r--    1 user       users        17318 Jan 16 12:06 kochi-mincho.tti
[user@localhost fonts]$ ttmkfdir .           <<<<<< TAKES SECONDS! >>>>>>
19
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-adobe-standard
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-ascii-0
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-fcd8859-15
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-ibm-cp437
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-ibm-cp850
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-ibm-cp852
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-ibm-cp866
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-1
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-10
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-15
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-2
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-3
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-4
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-5
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-7
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-9
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-koi8-r
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-koi8-ru
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-microsoft-cp1251
[user@localhost fonts]$  ttmkfdir . >fonts.scale
[user@localhost fonts]$ mkfontdir -e /usr/X11R6/lib/X11/fonts/encodings -e
/usr/X11R6/lib/X11/fonts/encodings/large .
[user@localhost fonts]$ ls -l
total 5832
-rw-r--r--    1 user       users         2877 Jan 16 12:48 encodings.dir
-rw-r--r--    1 user       users         1436 Jan 16 12:48 fonts.dir
-rw-r--r--    1 user       users         1436 Jan 16 12:47 fonts.scale
-rw-r--r--    1 user       users      5925220 Jan  7 17:32 kochi-mincho.ttf
-rw-r--r--    1 user       users        17318 Jan 16 12:06 kochi-mincho.tti
[user@localhost fonts]$ ttmkfdir .
19
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-adobe-standard
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-ascii-0
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-fcd8859-15
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-ibm-cp437
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-ibm-cp850
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-ibm-cp852
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-ibm-cp866
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-1
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-10
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-15
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-2
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-3
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-4
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-5
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-7
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-9
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-koi8-r
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-koi8-ru
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-microsoft-cp1251


	

Additional info:
This exact behavior slows down XFree86 xfs start up times too.
I suggest a quick solution:
Just add removing of preexisting encodings.dir, fonts.dir, fonts.scale before
processing a directory in xfs init script.
Comment 1 Alexei Podtelezhnikov 2002-01-16 22:43:31 EST
Just checked mandrakes version of ttmkfdir... This one at least obeys -c (less 
complete) options. Also it work very fast no matter if encodings.dir is 
present or not. I like it. It still ignores encodings info inside ttf. Well, 
it's better mantained at the moment. 
Comment 2 Alexei Podtelezhnikov 2002-01-17 03:59:14 EST
Same story is with Debian's version of ttmkfdir. This one gives consistent 
output. All versions so far proved to be to smart by ignoring ttf-defined 
encoding tables.
Comment 3 Alexei Podtelezhnikov 2002-01-17 13:44:19 EST
With debian's ttmkfdir I get this no matter is encodings.dir is there or not.

[apodtele@chemcca18 fonts]$ ttmkfdir
13
kochi-mincho.ttf -misc-Kochi 
Mincho-medium-r-normal--0-0-0-0-c-0-jisx0201.1976-0
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-koi8-ru
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-koi8-r
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-fcd8859-15
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-15
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-10
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-9
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-7
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-5
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-4
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-3
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-2
kochi-mincho.ttf -misc-Kochi Mincho-medium-r-normal--0-0-0-0-p-0-iso8859-1

This seems the most reasonable.

Comment 4 Mike A. Harris 2002-02-01 04:38:22 EST
The encodings.dir files are completely unnecessary now if I understand
correctly.  I think I'll probably just remove all of them and avoid this
issue entirely.

Comment 5 Mike A. Harris 2002-03-28 13:53:52 EST
Yu Shao has made some enhancements to ttmkfdir2 for our upcoming release.
IMHO we should probably remove the -e args from all calls to mkfontdir
in our post scripts.

encodings.dir indeed is deprecated and future XFree86 releases will not
use these files.  They are currently not necessary either.

Yu, can you look into this and comment your opinion on this?

Thanks
Comment 6 Yu Shao 2002-04-01 20:23:39 EST
The slowness is mainly because the original author didn't pay much attention to
the huge charset of CJK(Chinese, Japanese, Korean) encodings, like new chinese
gb18030 encoding has over 30,000+ characters. 

Mandrake and Debian's ttmkfdir are working by only checking about 200 sample
characters from each of those asian encodings, this is definitely not right.

Please have a look of our 7.3's ttmkfdir, the speed problem is addressed. 
Comment 7 Mike A. Harris 2002-04-03 09:12:38 EST
Bug flagged as per developer whiteboard.
Comment 8 Mike A. Harris 2002-05-21 01:39:36 EDT
Closing bug as CURRENTRELEASE of 7.3.  Changing component to XFree86, since
ttmkfdir is now part of our XFree86 packaging.

mkfontscale will replace ttmkfdir in the future.

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