[Dev-luatex] Problem with CFF fonts having em-size other than 1000

Jonathan Kew jonathan at jfkew.plus.com
Sat Mar 28 11:42:30 CET 2009


Hi ChoF,

You're right, there is an issue with OpenType/CFF fonts with non-1000  
unit emsize, when they are embedded at CIDFontType0C. The behavior of  
Adobe Reader changed between versions 7 and 8, so that with the newer  
versions (Reader 8 and Reader 9) the font is not scaled according to  
the FontMatrix.

I reported this to Adobe some time ago as a bug in Reader 8, and had  
some discussion with them about it, but this is an area where the spec  
is quite confusing. I don't recall the exact details, but I think the  
PDF spec does not actually document FontMatrix as a recognized key in  
the situation where (x)dvipdfmx uses it in this case. In fact, I just  
found a note that says:

<quote src="PDF Reference v1.5, p.356">
The glyph coordinate system is the space in which an individual  
character’s glyph
is defined. All path coordinates and metrics are interpreted in glyph  
space. For all
font types except Type 3, the units of glyph space are one-thousandth  
of a unit of
text space; for a Type 3 font, the transformation from glyph space to  
text space is
defined by a font matrix specified in an explicit FontMatrix entry in  
the font.
</quote>

Given that other documents such as the Type 1 spec *do* document  
FontMatrix, and appear to permit other-than-1000 unit matrices, I find  
this really strange. It seems that when a font is embedded in PDF, the  
"recommendation" to use 1000-unit emsize turns into a "requirement",  
and readers that respect the FontMatrix in non-Type3 fonts may  
actually be incorrect. :(

It's all quite confusing! I think the best thing would be if  
(x)dvipdfmx and luatex could avoid relying on FontMatrix in  
CIDFontType0C fonts, given that support for this is inconsistent  
between different viewers. But I don't know how easily this can be  
done, given the requirement to access arbitrary glyphs by index, not  
just draw text through a standard encoding.

Jonathan

On 28 Mar 2009, at 08:06, Jin-Hwan Cho wrote:

> Hi, Khaled Hosny,
>
> dvipdfmx-20080607 is the one included in TeXLive 2008. It's quite  
> recent version
> to test this problem. I think that your executable "dvipdfmx" is not  
> in the proper place
> in which the kpathsea library can work.
>
> Anyway I realized the reason why Adobe Reader 8, 9 and Leopard's  
> Preview does not
> work with OTF fonts of emSize other than 1000.
>
> What I tested is as follows:
>
> 1. XeTeX may read upm2048cff.otf directly and xdvipdfmx write in the  
> CIDFontType0C
> format. In this case, I could see the around two times bigger font.
>
> 2. I used TeX in the last sample, and generated PDF with dvipdfmx.  
> In this case the font
> is written in the Type1C format. In this case, I could see the right  
> sized font.
>
> The difference is just the format. CIDFontType0C and Type1C is  
> almost same because
> all of them uses the CFF format. But CIDFontType0C is considered as  
> a CID-keyed font.
> Simply, it has a few more information than the Type1C format.  
> However, we can assume
> that they are same.
>
> So I tried to change FontMatrix information of the CIDFontType0C  
> font in the PDF result
> (generated by xdvipdfmx). The interesting result was:
>
> Adobe Reader 9 and Leopard's Preview ignores the FontMatrix  
> information,
> but Adobe Reader 7 does not ignore the FontMatrix information.
>
> Now I tried to change FontMatrix information of the Type1C font in  
> the PDF result
> (generated by dvipdfmx). The result was:
>
> Adobe Reader 9 shows an error message,
> but Adobe Reader 7 and Leopard's Preview does not ignore the  
> FontMatrix information.
>
> I do not know why FontMatrix information was ignored only in the  
> CIDFontType0C format.
> And, Adobe Reader 9 does not look good.
>
> Best regards, ChoF.
>
> On Mar 28, 2009, at 6:03 AM, Khaled Hosny wrote:
>
>> On Fri, Mar 27, 2009 at 07:14:01PM +0900, Jin-Hwan Cho wrote:
>>> Could you show me any DVI (or XDV) file which cause your problem?
>>
>> I couldn't run your test, I' getting:
>>
>> ** WARNING ** Could not open config file "dvipdfmx.cfg".
>> mytest.dvi -> mytest.pdf
>>
>> ** WARNING ** Failed to load AGL file "pdfglyphlist.txt"...
>> ** WARNING ** Failed to load AGL file "glyphlist.txt"...
>> [1
>> ** WARNING ** Could not locate a virtual/physical font for TFM  
>> "cmr10".
>> ** WARNING ** >> There are no valid font mapping entry for this font.
>> ** WARNING ** >> Font file name "cmr10" was assumed but failed to  
>> locate
>> that font.
>> ** ERROR ** Cannot proceed without .vf or "physical" font for PDF
>> output...
>>
>> I think I'm using an old dvipdfmx version (dvipdfmx-20080607), I  
>> could
>> not figure how to build the latest release either.
>>
>> However, the attached XDV file gives the result as luatex with
>> xdvipdfmx.
>>
>> Regards,
>> Khaled
>>
>>
>> -- 
>> Khaled Hosny
>> Arabic localiser and member of Arabeyes.org team
>> Free font developer
>> <test.tex><test.xdv>
>



More information about the dev-luatex mailing list