[XeTeX] xdvipdfmx segmentation fault

Jonathan Kew jonathan_kew at sil.org
Wed Jul 18 23:39:04 CEST 2007

On 18 Jul 2007, at 6:14 am, Rémy Oudompheng wrote:

> oudomphe at clipper.ens.fr (Rémy Oudompheng) writes:
>> Gerrit Sangel <z0idberg at gmx.de> writes:
>>> I’ve got the same problems, with a 32 bit Gentoo (x86).
>> This is because Gentoo sets FT_CONFIG_OPTION_OLD_INTERNALS to  
>> False in
>> latest Freetype versions. There must be some code in xdvipdfmx using
>> it. Other distros may leave it to True to preserve compatibility  
>> with old
>> programs.
> I took libXfont (bug #6918) as an example, so this is a patch to avoid
> accessing the long_metrics field in TT_HoriHeader, the metrics  
> should be
> retrieved by using the hmtx and vmtx tables.
> <xdvipdfmx-0.4-avoid-ftinternals.patch>
> It now works with the new FreeType, and I hope it does not change the
> expected behaviour.

Many thanks for working on this. When I get back from the TUG  
conference, I'll look at it more closely, but it seems like the right  
thing to do.

One minor disadvantage I see is that it will re-read the hmtx or vmtx  
table for every glyph_array that is processed (typically each word of  
the text). Even if Freetype does a good job of caching the tables  
(which I assume it does), it is copying the entire table to a local  
buffer each time. Maybe we should consider attaching the buffer to  
xdvipdfmx's loaded_font object, so that it only needs to be loaded  
via Freetype once. (But the cost may not be significant; it would be  
interesting to run some tests to see if it has a measurable impact.)

Another question would be whether the latest Freetype solves the  
problem with vertical metrics of CFF fonts; maybe we can remove this  
code altogether and rely on the path based on FT_Load_Glyph and  
reading values from font->ft_face->glyph->metrics. That would  
simplify things, if it now works correctly.


More information about the XeTeX mailing list