0

How do I produce a pdf, with xelatex, in a way that all fonts are embedded? I was under the impression that this was default but the printer says that they are not, and I use probably some fonts that are not available in the printer's computer so they become squares (see the image), but not always, so I guess there is some partial embedding... Please see these answers that are connected:

Producing PDF/X compliant document with XeLaTeX

How to embed fonts at compile time with pdflatex

The solutions probably work but require many steps. They are also old solutions. So maybe do you know if there is a newer, quicker way, to produce a printer ready pdf with latex? At the moment, I have to 1. create book layout in indesign; 2. import pdf in indesign; 3. create adequate pdf from indesign. (would be easier with acrobat pro but print to pdf is not available on the Mac version...).

Sorry for the long question and thanks!

MWE:

\documentclass{book}

\usepackage{fontspec} \usepackage{polyglossia} \usepackage{ebgaramond} \setdefaultlanguage{italian} \setotherlanguage{hebrew} %\newfontfamily{\hebrewfont}{New Peninim MT}

\begin{document} Some text \end{document}

enter image description here

Haim
  • 487
  • I'd assume that all the latex variants always embed fonts in the PDF. But as you give no code example, we have no idea what you are actually doing, so there is no way for us to help. – daleif Sep 07 '23 at 15:11
  • I put the preamble in the question, thanks – Haim Sep 07 '23 at 15:12
  • 3
    Not preamble or sniplet, always full but minimal examples. Exactly which format are the fonts you are using? – daleif Sep 07 '23 at 15:14
  • Please see the MWE – Haim Sep 07 '23 at 15:18
  • Can you produce an example using a font everyone has? Or is it a problem with this font? – cfr Sep 08 '23 at 06:44
  • I reformulate the question. – Haim Sep 08 '23 at 12:15
  • Is there any possibility that this is a text encoding problem? That is, does xelatex expect utf-8, but you are typing in utf-16 or something else? – rallg Sep 08 '23 at 21:57
  • I don't think so. I added my language settings to the MWE. Thanks – Haim Sep 10 '23 at 22:26
  • For pdfTeX, embedding is partially controlled by a distribution or local configuration file. However, this primarily affects the 'core' postscript fonts and I'd expect any modern installation to default to embedding anyway. Have you looked to see what your PDF viewer says about the fonts? Does it say they are embedded or not? (Nor do I understand your workflow. Print to PDF on Mac always used to be provided by the OS - not the application. Perhaps Macs have regressed since then. But why print to PDF if you're producing PDF anyway?) – cfr Sep 11 '23 at 00:43
  • 1
    Adding a bounty doesn't make your question any more tractable. I can't compile your example at all. You don't say what your PDF viewer says about the fonts. However, the answer to the question you actually ask in the bounty is 'No, LaTeX does not produce printer ready PDFs because LaTeX doesn't produce PDFs at all. LaTeX is the format. Whether a PDF of some kind, a DVI or something else is produced depends on other things such as the engine, options used, local configuration etc.' However, I doubt that's what you want to know. – cfr Sep 11 '23 at 00:48
  • xelatex embeds fonts, and in your example the fonts are certainly embedded. Which means your real document does something else. Perhaps you include graphics which don't have all fonts embedded? – Ulrike Fischer Sep 11 '23 at 07:22
  • @cfr 1. What does it mean you cannot compile my MWE? It is the most basic it can get. What error do you obtain? Maybe you just miss the font, but I added it in answer to another user. 2. Yes I know latex, pdftex, etc. I also assume you know and most reader know, so we can use the linguistic shortcut, even if not really precise, that we do use latex ``to produce a pdf''. 3. The print to pdf driver of acrobat has option to embed fonts partially or totally controlling the percentage, like there is in indesign; I do assume the Mac driver does this under the cover when producing pdf/A. – Haim Sep 11 '23 at 13:35
  • @ crf 4. Sorry I'm not familiar with the bounty system, I just had a pop up and I said yes. Will not do this anymore if bad practice. There are many questions on fonts embedding in latex, so I thought could be useful to flag this and produce an updated clear answer. – Haim Sep 11 '23 at 13:37
  • @ Ulrike Thanks. I agree with you and I never had a problem with printing houses. I'm adding a picture of a page after the publisher imported the pdf in InDesign, so to understand. – Haim Sep 11 '23 at 13:39
  • @Haim If you add a space between @ and the username, the users won't be notified – samcarter_is_at_topanswers.xyz Sep 11 '23 at 13:41
  • Thanks for the clarification! – Haim Sep 11 '23 at 13:50
  • 3
    I cannot compile your MWE because the font New Peninim MT is not included in latex distributions. – Sverre Sep 11 '23 at 14:03
  • @Sverre Yes I know. I added to clarify all my fonts. Will comment out. Thanks – Haim Sep 11 '23 at 14:10
  • Also: Maybe I'm wrong in thinking it is a problem of fonts not embedded and the reason of the square is a different one? Please latex experts, help me in this, as I am no expert... Thanks! – Haim Sep 11 '23 at 15:10
  • You appear to be asking about PDFLaTeX, but your MWE does not compile in PDFLaTeX. even with the font. – Davislor Sep 11 '23 at 15:39
  • well you clearly have problems with quote signs and with hyphens. Which means that you show an example which actually use this symbols. And you should put the pdf somewhere for inspection. Also add \XeTeXtracingfonts=1 to your document and then check in the log where your ebgaramond is from, they are various versions around and perhaps yours is broken. – Ulrike Fischer Sep 11 '23 at 15:53
  • Are you getting any warning messages about a particular character, such as U+201C, being missing from a font? If not, try adding \tracinglostchars=3. – Davislor Sep 11 '23 at 16:14
  • @Davislor The PDF would demonstrate the problem on the OP's machine from the beginning in that case. Perhaps I misunderstood, but I thought the original PDF looked fine and the problem only manifested at the printer's. – cfr Sep 11 '23 at 16:16
  • Your example compiles fine for me. I added hyphen, endash, emdash and some quotation marks and it still compiles fine, with a subset of the font embedded. I have had a problem with missing characters with pdfTeX, but I doubt the issue you're having is that one. (I think that was a memory issue on the printer side, but I don't think a publisher would be printing to a photocopier without the capacity to cope with the volume of font.) – cfr Sep 11 '23 at 16:25
  • If that still doesn’t work, you might check the output of pdffonts SomeFile.pdf. All fonts should show up as CID Type 0C Identity-H yes yes yes. – Davislor Sep 11 '23 at 16:29
  • I would start with @UlrikeFischer 's suggestions. Partly because they are UlrikeFischer's; partly because you don't want to apparently solve the problem while potentially letting more subtle problems slide by which may not be easily noticed at this stage. If your viewer doesn't tell you, you should definitely use pdffonts to check the embedding, as Davislor suggested. – cfr Sep 11 '23 at 16:36
  • @ulrike Thanks I can see this re the Garamond font: (/usr/local/texlive/2021/texmf-dist/tex/latex/ebgaramond/ebgaramond.sty Is this the info I need? – Haim Sep 11 '23 at 17:06
  • To clarify: PDF is fine in my system. Problems happen only when it get's imported in InDesign by my publisher. If I import into InDesign in my Mac, there is no issue. – Haim Sep 11 '23 at 17:11
  • @Davislor Thanks and yes, I run pdffonts and I obtain the expected result – Haim Sep 11 '23 at 17:17
  • @Davislor But the hebrew font gives me: MWTWWM+NewPeninimMT CID TrueType Identity-H yes yes yes – Haim Sep 11 '23 at 17:19
  • @Haim Okay, that’s TrueType instead of OpenType format. The three yeses mean it’s subset-embedded in Unicode, so that’s not the problem. – Davislor Sep 11 '23 at 17:23
  • @Davislor Ok thanks this is clear. So I guess that, as I suspected, all fonts get embedded by default and the problem that my publisher had in importing the pdf come from elsewhere... – Haim Sep 11 '23 at 17:52
  • @Haim Is your published recompiling from source or printing your PDF? – Davislor Sep 11 '23 at 17:53
  • @Davislor I sent the pdf ready to go but I guess they imported it in InDesign to add few pages at the end. Now what they did was to send me the end pages. I created a pdf ready for print, with pdfpages, and sent this to the printing house... Waiting to hear if all went well! – Haim Sep 11 '23 at 18:43
  • Are you processing a document that was originally typed on a word processor application? If so, the text may contain hidden control codes inserted by the word processor. A plain text editor may ignore them, but TeX does not ignore them. Instead, TeX will try to print characters that have no printable form, because they are control codes. If you did create the document in a word processor, be sure that it is exported as plain text only, utf-8. – rallg Sep 11 '23 at 18:56
  • @rallg No. The document has been written all in plain text using TexShop and VSCode... So I do not think this is the problem. Also: I have no issues and no warnings when I produce my pdf and when I see it. The problem happened ONLY when it was imported into InDesign in my publisher's computer – Haim Sep 11 '23 at 19:08
  • I guess the answer to my question is: Yes, compiling with xelatex > pdflatex should produce a pdf with embedded fonts. This can be checked with the pdffonts command. This means a package like PDFX (https://ctan.org/pkg/pdfx) is not anymore necessary? Or is there any advantage in using it? – Haim Sep 11 '23 at 22:06
  • Then there is the second issue that is: what happened to my pdf when it was imported in inDesign by the publisher? I guess we have no elements to answer this but we can assume it is not an issue of font embedding? – Haim Sep 11 '23 at 22:07
  • Do you use microtype? – cfr Sep 12 '23 at 01:24
  • @cfr Yes I do use microtype – Haim Sep 12 '23 at 02:04
  • 1
    So I'm wondering about the way microtype works with XeLaTeX. I don't know if this is still current, but with pdfLaTeX, you'd get multiple embeddings of font subsets for expansions of the fonts, where this occurred. In my case, I think I lost characters because the resulting volume of embedded fonts exceeded what the printer could cope with. I wouldn't expect that with a professional printing press, but I'm wondering if there's some interaction there - especially if the missing characters aren't consistently absent e.g. you have missing quotation marks on some lines but not others. – cfr Sep 12 '23 at 03:29
  • @cfr Thanks for your comment. I think microtype is very helpful so it would be tough to not use it. Anyway, as un update, the printing house had finally no problem with my pdf produced directly from pdflatex and the book is in press! – Haim Sep 13 '23 at 14:02
  • @Haim Congratulations! For future reference, it is possible to fine-tune which features of microtype are used. I'm not sure which XeTeX supports anyway and it might be irrelevant. I was never really sure what happened in my case exactly, but ended up printing as an image (which takes forever). – cfr Sep 13 '23 at 16:17

0 Answers0