[NTG-pdftex] 1.20b-rc5 writet1.c problem with HUGE fonts

Hartmut Henkel hartmut_henkel at gmx.de
Sat Dec 11 17:15:32 CET 2004

When trying to use the GoudyIn.pfb font with its demo .tex file (all on
CTAN), i get a segfault from pdftex. This font has very complicated
glyphs, so that the alloc_array macro in writet1.c has to re-allocate
memory; this normally never happens -- only with a few fonts as large as
GoudyIn.pfb. Unfortunately these are also the nicer fonts that give an
icing to pdftex...

The problem with such a huge font is, that the xretalloc() function
called by alloc_array moves the array base to another address, so any
pointer relying on the former array place will now point into nirvana.
And there seem to be a few pointers of this type :-(

Thorougly fixing this weird re-allocation stuff in writet1.c looks like
a complicated and risky thing. A q&d cure to get font GoudyIn.pfb and
similar ones running is to once again increase T1_BUF_SIZE in writet1.c:

#define T1_BUF_SIZE   0x8000

(Looks safe, and nowadays memory is cheap.) Then it works ok, but only
as no re-allocation is needed. It will crash again when even larger
glyphs appear, so it's definitely an ugly kludge.

(In former times the alloc_array macro itself had a bug, but this has
been fixed by Thanh.)

What to do?

Regards, Hartmut

More information about the ntg-pdftex mailing list