OpenType Postscript fonts having em-size other than 1000 don't show correctly with adobe reader (I tested version 8), see the attached test suit. Other viewers as Xpdf and libpoppler or muPDF based one show them correctly, but ghostscript don't show any text at all. This also happens with XeTeX (xdvipdfmx) and is suggested to be related to the way CFF fonts are embeded[1][2]. I'm not sure if this is really a bug, such fonts seem to be problematic and only adobe products seem to generate correct PDFs of them. Regards, Khaled [1]http://www.tug.org/pipermail/xetex/2009-February/012149.html [2]http://dev.typophile.com/node/46451 (especially the last post) -- Khaled Hosny Arabic localiser and member of Arabeyes.org team Free font developer
Khaled Hosny wrote:
I'm not sure if this is really a bug, such fonts seem to be problematic and only adobe products seem to generate correct PDFs of them.
I'll see if I can do something. Btw, it always surprises me how Adobe manages to break something in newer versions of their software that was working fine in older versions, and then claim that the third-party program is at fault. Best wishes, Taco
Taco Hoekwater
Khaled Hosny wrote:
I'm not sure if this is really a bug, such fonts seem to be problematic and only adobe products seem to generate correct PDFs of them.
I'll see if I can do something. Btw, it always surprises me how Adobe manages to break something in newer versions of their software that was working fine in older versions, and then claim that the third-party program is at fault.
As long as they are working with published standards, I don't see anything wrong with that. Go beyond the specs, and you don't get a promise of compatibility. It is not like TeX would be any different. It is just enfuriating for people putting out lookalikes which are not adopted into use presumably because of the cost of incompatibilities, when the upstream software is much more incompatible on each version change. That's life. -- David Kastrup
On Mar 27, 2009, at 1:51 PM, Khaled Hosny wrote:
OpenType Postscript fonts having em-size other than 1000 don't show correctly with adobe reader (I tested version 8), see the attached test suit. Other viewers as Xpdf and libpoppler or muPDF based one show them correctly, but ghostscript don't show any text at all.
This also happens with XeTeX (xdvipdfmx) and is suggested to be related to the way CFF fonts are embeded[1][2].
I checked your test.pdf in Adobe Reader 9, and realized what the
problem is.
But the PDF file was generated by LuaTeX. So I tested the attached
font with
tex as follows:
1. mytest.tex:
\special{pdf:mapline upm2048cff upm2048cff
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
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
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
On Sat, Mar 28, 2009 at 05:06:46PM +0900, Jin-Hwan Cho wrote:
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.
Not sure if this is useful, but Adobe's InDesign seems to write the fonts in Type1C format (at least this what "pdffonts" say). Attached a PDF generated by InDesign, if it is of any help. Thanks for the detailed explanation! Regards, Khaled -- Khaled Hosny Arabic localiser and member of Arabeyes.org team Free font developer
On Mar 29, 2009, at 2:57 AM, Khaled Hosny wrote:
On Sat, Mar 28, 2009 at 05:06:46PM +0900, Jin-Hwan Cho wrote:
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.
Not sure if this is useful, but Adobe's InDesign seems to write the fonts in Type1C format (at least this what "pdffonts" say). Attached a PDF generated by InDesign, if it is of any help.
Surely as I expected. Because the font was written in the Type1C format, we have no problem in viewing the contents with Adobe Reader 9 and Leopard's Preview. Then there is only one way, that is, not to use the CIDFontType0C format. But how can we avoid this format in the case of non-latin fonts? I think that because of this reason, Jonathan didn't do anything even though he already knew this problem very well. Best regards, ChoF.
participants (5)
-
David Kastrup
-
Jin-Hwan Cho
-
Jonathan Kew
-
Khaled Hosny
-
Taco Hoekwater