8

If I compile the following minimal code with LuaLaTeX I seem to get a faulty pdf:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Times New Roman}

\begin{document}
text
\end{document}

If I open the resulting pdf-file in Adobe Acrobat and try to export it as a Word Document I an told that this is a bad pdf because of a "bad Type0 font":

Abobe Acrobat Export error message

Is it me who is doing something wrong or LuaLaTeX? Or fontspec? (The Font I'm using is the OpenType Times New Roman that comes with Windows7.)

Update: The problem also occurs with \setmainfont{Minion Pro}, but the error message is slightly different: Instead of "bad Type0 font" it says "cannot find CMap resource file".

Christoph
  • 2,467
  • 1
    Is the example really minimal in the sense that the error goes away if you remove [Ligatures=TeX]? Does the error occur with other fonts? Do you get errors from other software that reads pdfs? Are you not able to post the pdf for others to look at because it's not legal to redistribute the font? –  Mar 17 '13 at 05:17
  • And what happens if you try using XeLaTeX on the same minimal example document? – kahen Mar 17 '13 at 07:54
  • copy the font file into your documents directory and then load it with the file name instead of the symbolic name. What happens? –  Mar 17 '13 at 08:35
  • Which TeX distribution do you use: Miktex, Texlive, or something else? Have you checked the .log file for error and/or warning messages? – Mico Mar 17 '13 at 10:09
  • At the end of the log file there should be an entry such as </Library/Fonts/Times New Roman.ttf>; the path will be different on your system, but the used font should be between <...>; check it. – egreg Mar 17 '13 at 11:08
  • Please take this up with Adobe Acrobat support; we have no way of knowing what the program is doing. – Martin Schröder Mar 17 '13 at 11:50
  • Could you paste in the contents of your .log file into your question? This will answer Mico and egreg's questions and it will tell us if luaotfload is doing anything strange. Your Times New Roman is one of the most widely used True Type fonts there are, and it is very strange for Acrobat to complain about it. – Charles Stewart Mar 17 '13 at 13:26
  • I can confirm the poster's problem on a mac, texlive 2012, on warnings in the log, only font entry is </Library/Fonts/Microsoft/Times New Roman.ttf>. This is the first time I have tried Acrobat Pro's export options - it fails on word, rtf and html export with the given error. There is no problem if the file is run through xelatex instead of lualatex. Removing the Ligatures setting makes no difference. normal in lualatex is "name:TimesNewRoman:mode=node;script=latn;language=DFLT;+tlig;+trep;" in xelatex: "Times New Roman/ICU:script=latn;language=DFLT;mapping=tex-text;" – Andrew Swann Mar 17 '13 at 13:48
  • 1
    I'm able to reproduce the problem. @BenCrowell -- the example is not minimal in that sense. The problem persists even without Ligatures=TeX. It also persists when I go from TNR (a TrueType font in an OpenType container) to, say, Minion Pro (a CFF font on an OpenType container). It disappears, though, when fontspec is removed altogether. – Nils L Mar 17 '13 at 13:49
  • ...which, of course, equals using Type1 rather than TrueType or CFF/Type2 fonts. Looks like Acrobat prefers one over the others. – Nils L Mar 17 '13 at 14:01
  • I can't post the (whole) logfile. It exeeds the characterlimit for a question. So @egreg: the font mentioned at the end of the logfile is C:/Windows/Fonts/times.ttf(as expected, I'd say). What was the purpose of looking this up? And @Mico: I'm using MikTeX 2.9 and I cannot find any errors or warning messages. – Christoph Mar 17 '13 at 18:07
  • @Herbert: I am not sure how to do that. What do you mean by document folder? – Christoph Mar 17 '13 at 18:09
  • 2
    I'm still not sure if this is something to take up with Adobe support since I have not had this problem with other pdf documents on which I used the export function. When people here say this is to local a problem, I partly agree. Only partly, because while I discovered the faultyness of LuaTeX pdfs when using Acrobat's Export feature, it may well cause problems in other contexts too. The question that remains, therefore, is whether this is the pdf produced by LuaLaTeX (in combination with fontspec) really faulty or is Acrobat's export feature faulty? – Christoph Mar 17 '13 at 18:21
  • 1
    I have voted to reopen, as it is a genuine problem, and there is some difference between xelatex and lualatex behaviour here. I don't know if it is related to http://tex.stackexchange.com/q/55098/15925. It would be nice to have an explanation. – Andrew Swann Mar 17 '13 at 18:27
  • @BenCrowell: I did not manage to post the pdf for inspection. If I try to post it as part of the question, it is transformed into an image, which is useless in this case. Yes, it also occurs with Minion Pro. I do not have any other software that exports pdfs to word. – Christoph Mar 17 '13 at 18:51
  • Strage stuff with LuaLaTeX and fontspec is also being reported here: http://tex.stackexchange.com/questions/58760/lualatex-fontspec-cannot-compare-documents-with-acrobat?rq=1 – Christoph Mar 17 '13 at 18:56
  • Google suggests that "printing out the PDF as a PDF using the Adobe PDF writer" and then doing the export may work. You could upload your .pdf to a file hosting site and share the link here. You might also check this thread on the adobe forums – Scott H. Mar 17 '13 at 20:18
  • 1
    @Christoph: As it is only Adobe support can tell us what Acrobat thinks is wrong with the PDF - or does Acrobat preflight produce any warnings helping here? – Martin Schröder Mar 18 '13 at 10:25
  • @Christoph Did you try with the new versions of LuaTeX and luaotfload? Current LuaTeX is 0.76 – egreg Jul 06 '13 at 22:29
  • @egreg It still fails with luatex beta-0.76.0-2013061817 (rev 4627) – Andrew Swann Aug 08 '13 at 09:52
  • We used to have the same issue. It is not Acrobat specific, one can use pdfminer, or---to be more accurate---its command line tool pdf2txt. Unfortunately, it worked on some computers and does not on others and I was not able to track it down. However, it works on an updated TeXLive 2013. The pdfs look just fine, but the pdfs are not searchable and, e.g., copy and paste does not work. – Andy Dec 23 '13 at 19:44
  • This question appears to be off-topic because it is about an issue with a third-party (commercial) tool. – Joseph Wright Aug 03 '14 at 10:29
  • I'm still not seeing this as a LuaTeX issue: we will need some real diagnostics on the PDFs produced showing where the issue is cf. the PDF spec to make any progress. – Joseph Wright Aug 03 '14 at 10:30

0 Answers0