Re: [NTG-pdftex] Question related to .ttc support
On Fri, Aug 08, 2008 at 07:07:37PM +0800, hzluo wrote:
Friends, I recently tested pdflatex with a Chinese font simsun.ttc, pdflatex report the following error:
!pdfTeX error: pdflatex (file simsun.ttc): cannot open Type 1 font file for reading
I checked the source code of pdflatex, found that pdflatex only takes .ttf files as the truetype fonts, there is no test for .ttc suffix. So, simsun.ttc is assumed to be a Type 1 font. Apparently it is wrong.
the manual says that if a fontfile has unknown extension, it will be treated as type1. Not quite right, but that's the expected bahaviour of pdftex in this case.
Is there any special reason to give up the .ttc support in pdflatex? I found that dvipdfmx supports simsun.ttc smoothly, so pdflatex should also do that, and it is quite simple. I have attached a tiny patch to fix this. Could anyone confirm it?
TTC is not truetype, but truetype collection. It's not supported by pdftex yet, since I don't know enough about this format yet and there seems to be very little interest in this format. Your patch changes pdftex so that it will treat TTC like truetype font. While it works for your case, I am not confident that it's the right way to do that. Someone with a thorough understanding of TTC format can comment on this? Regards, Thanh
Thanh Han The wrote:
Your patch changes pdftex so that it will treat TTC like truetype font. While it works for your case, I am not confident that it's the right way to do that. Someone with a thorough understanding of TTC format can comment on this?
IIRC, the patch will give access to the *first* font in the collection, because that has an offset of zero (which makes the first font in the ttc behave the same as a standalone ttf font, when the ttc header is ignored). You could apply the patch but not document support for ttc files (because the really patch doesn't implement that). This gives a small subset of ttc functionality, but still better than mishandling the format completely. Best wishes, Taco
participants (2)
-
Taco Hoekwater
-
Thanh Han The