[XeTeX] TemporaLGCUni-Italic: Parsing CFF DICT failed

Jonathan Kew jonathan_kew at sil.org
Sat Mar 8 11:24:44 CET 2008


On 7 Mar 2008, at 8:04 pm, Alexey Kryukov wrote:

> On Tuesday 04 March 2008, Jonathan Kew wrote:
>>
>> Looking in the source code, it seems that error code -3 is
>> CFF_ERROR_STACK_UNDERFLOW. But why that's happening -- whether it's a
>> genuine error in the font, or a bug in xdvipdfmx -- I don't know
>> without further investigation. I'm not very familiar with CFF font
>> structures, so tracing this will be fairly tedious.... :(
>
> OK, I think I have figured out what's wrong. The italic version
> of the font has an empty StemSnapV array in its PS Private data,
> and this stumbles xdvipdfmx which assumes every operator should
> be preceded by some operands. Particularly I think this is a bug
> in xdvipdfmx: although the specification doesn't say explicitly
> that dictionary keys with no value are allowed, other tools
> (e. g. TTX or FontForge) seem to have no problems with this situation.
>
> So my opinion is that the CFF_ERROR_STACK_UNDERFLOW error should
> not be triggered at the line 305 of cff_dict.c, if stack_top is 0.

Thanks for your analysis of the issue. You are right, it is unclear  
from the CFF spec whether an operator like StemSnapV should be  
allowed with no operands; it doesn't really make any sense, but on  
the other hand it should be harmless.

I have patched the xdvipdfmx code so that this error no longer  
occurs. It will only be considered underflow if the dict operator  
requires exactly one operand, not if it expects a variable-size array  
or set of values.

With this change, your font seems to work fine.

JK



More information about the XeTeX mailing list