When running ttmkfdir (the C++ version) with Korean and many 
other fonts, it chokes horribly with the following errors:

pts/25 root@devel:/usr/share/fonts/ko/TrueType# ttmkfdir -o fonts.scale
unexpected token FIRSTINDEX in file 
/usr/X11R6/lib/X11/fonts/encodings/large/ksc5601.1992-3.enc.gz, 
line 8
unexpected token 0x84 in file 
/usr/X11R6/lib/X11/fonts/encodings/large/ksc5601.1992-3.enc.gz, 
line 8
unexpected token FIRSTINDEX in file 
/usr/X11R6/lib/X11/fonts/encodings/large/big5.eten-0.enc.gz, line 
7
unexpected token 0xA0 in file 
/usr/X11R6/lib/X11/fonts/encodings/large/big5.eten-0.enc.gz, line 
7
unexpected token FIRSTINDEX in file 
/usr/X11R6/lib/X11/fonts/encodings/large/jisx0208.1990-0.enc.gz, 
line 5
unexpected token 0x20 in file 
/usr/X11R6/lib/X11/fonts/encodings/large/jisx0208.1990-0.enc.gz, 
line 5


After a fair bit of investigation, I downloaded the Debian 
ttmkfdir and the Mandrake one as well.  Those ttmkfdir's dont 
produce the correct results either but at least don't SEGV on 
korean fonts.

The problem is that ttmkfdir doesn't know how to cope with 
encoding files that contain the line "FIRSTINDEX" in them as per 
the README.fonts file.

I'm wondering what the intention of adding FIRSTINDEX to the 
encoding files is, as it prevent's ttmkfdir from working 
correctly if an encodings.dir file is present.
How to reproduce:

1) Install the Red Hat Linux ttfonts-ko font package from rawhide 
   on an XFree86 4.2.0 installed system.

2) Go into the directory containing the korean ttf fonts.

3) rm fonts.{dir,scale} encodings.dir

4) run the following inside the korean ttf dir:
   ttmkfdir -o fonts.scale
   mkfontdir -e /usr/X11R6/lib/X11/fonts/encodings \
             -e /usr/X11R6/lib/X11/fonts/encodings/large .

5) rm fonts.dir fonts.scale
6) ttmkfdir -o fonts.scale

Boom.  The error at the top is displayed.  Now I've looked at the 
source code of libXfont and the font re-encoding stuff in 
particular, and I can see where FIRSTINDEX gets parsed in the 
XFree86 libraries, however the ttmkfdir utility cannot handle 
this, so it fails and SEGV's.

Obviously, the long term fix is to fix ttmkfdir itself to handle 
this properly.  However I get the impression that FIRSTINDEX is 
not a critical thing, and not too widely used.  Is this 
assumption correct?

Does someone have patches for ttmkfdir (either the C++ one or the 
original C one) which fix it to work properly with FIRSTINDEX?

My current short term solution in mind is to remove the 
FIRSTINDEX entries from the encoding files so that things work 
for now as they always have, and in the mean time see if there 
are patches floating around for ttmkfdir to handle this for the 
longer term.

Feedback appreciated.


-- 
----------------------------------------------------------------------
Mike A. Harris                  Shipping/mailing address:
OS Systems Engineer             190 Pittsburgh Ave., Sault Ste. Marie,
XFree86 maintainer              Ontario, Canada, P6C 5B3
Red Hat Inc.                    Phone: (705)949-2136
http://www.redhat.com           ftp://people.redhat.com/mharris
Red Hat XFree86 mailing list:   [EMAIL PROTECTED]
General open IRC discussion:    #xfree86 on irc.openprojects.net
----------------------------------------------------------------------

_______________________________________________
Fonts mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/fonts

Reply via email to