[XeTeX] how do I embed fonts into a a xelatex generated pdf?

Zdenek Wagner zdenek.wagner at gmail.com
Fri May 4 10:48:40 CEST 2012


2012/5/4 Wilfred van Rooijen <wvanrooijen at yahoo.com>:
> Hello,
>
> Always be careful with pdf2ps. If one converts PS to PDF, information is
> lost - this is one of the reasons that the PDF file is usually smaller in
> size than the PS file. So it is technically not always possible to perfectly
> reconstruct a PS from a PDF. So be careful, especially if the material is to
> be printed professionally.
>
> Some tips and tricks that I find useful:
>
> - EPS has a built-in JPEG support. If you use the program "jepg2ps", the
> resulting EPS will be only marginally larger than the original JPEG file.
> - Convert EPS to PDF with ps2pdf
> - Use pdfcrop to cut off irrelevant whitespace from a PDF
> - If you want to use matlab figures (or from a similar software), then
> saving the output as PS gives you some more control if you want to make a
> PDF - but at the expense of more work for you. Note that scilab (an
> open-source and free matlab-like software) has very poor support for EPS and
> PDF, but it is still workable.
> - Use pdfpages.sty to manipulate external PDFs directly into your latex
> document

pdfpages operates on whole pages, for inclusion of images in PDF
\includegraphics from the graphicx packes is more appropriate. You can
even include a selected page from a multipage PDF by specifying tha
page option, the default for \includegraphics is page=1.

> - Use pdftk if you want to do fancy things with a PDF file (merging,
> splitting, nup printing, etc)
>
> Cheers,
> Wilfred
>
> ________________________________
> From: Adam Russell <arussell at cs.uml.edu>
> To: xetex at tug.org
> Sent: Friday, 4 May 2012, 3:02
>
> Subject: Re: [XeTeX] how do I embed fonts into a a xelatex generated pdf?
>
> On 5/3/12 1:10 PM, xetex-request at tug.org wrote:
>>> Date: Thu, 3 May 2012 11:08:00 +0200
>>> From: Zdenek Wagner<zdenek.wagner at gmail.com>
>>> To: Unicode-based TeX for Mac OS X and other platforms<xetex at tug.org>
>>> Subject: Re: [XeTeX] how do I embed fonts into a a xelatex generated
>>>     pdf?
>>> Message-ID:
>>>     <CAC1phybAu4bH1TL+yP+ExpOhJumnQ1Ms56Gh9mAP-LzdYGZxDQ at mail.gmail.com>
>>> Content-Type: text/plain; charset="ISO-8859-2"
>>>
>>> Short answer: you have to buy Helvetica.
>>>
>>> Long answer: There are basic 15 PS fonts and basic 35 PDF fonts that
>>> must be according to the specification available everywhere. However,
>>> this requirement is broken even in Adobe products (the author of the
>>> specification) and it is quite common to see different versions of
>>> Times and Helvetica with different metrics (it cost me some money and
>>> damaged output to discover this crucial problem). It is therefore
>>> good (and required by DTP studios and printer houses) to embed all
>>> fonts. These 35 basic fonts are commercial and thus cannot be
>>> distributed with TeX. There are free replacements (from URW and other
>>> vendors). Now you have two options:
>>>
>>> 1. Embed the replacement fonts possibly losing quality
>>> 2. Do not embed the font and hope that the user has either the
>>> commercial font or a replacement font that will not be worse.
>>>
>>> Of course option 1 is better unless you know that the user has the
>>> commercial font with exactly the same metrics as you. You have to look
>>> into the manual of your TeX distribution how to instruct it to embed
>>> all fonts (it is done by updmap-sys in TeX Live). If you want to have
>>> fonts with better quality, you can consider using TeX Gyre Heros
>>> instead of Helvetica.
>>>
>>> Still one problem remains. You may include images created by tools as
>>> gnuplot or inkscape that insert texts in Helvetica but do not embed
>>> the font. It will need some tweaking depending on the tool.
>> Ah! That is exactly my problem I now realize. My paper in and of itself
>> does not use Helvetica but I am using
>> gnuplot to generate figures. So, I guess I am going with (2). The use of
>> Helvetica in the figures is so
>> small that hopefully any difference will be so small as to be
>> undetectable. I am willing to bet that Helvetica is a
>> common enough font and gnuplot is a common enough tool that this
>> shouldn't be an issue. We'll see...
>> And also, just for the record, I found these directions on embedding
>> fonts to be very clear:
>> http://confsys.encs.concordia.ca/public_files/embeded_fonts.php
>> Thank you very much for the help!
> One final thing. I just discovered a clever workaround.
> For the entire document run pdf2ps
> pdf2ps document.pdf
> and the run this command on the ps file
> ps2pdf14 -dPDFSETTINGS=/prepress document.ps
> This seems to work for embedding the fonts without having to regenerate
> anything!
>
>
>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>   http://tug.org/mailman/listinfo/xetex
>
>
>
>
>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex
>



-- 
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz



More information about the XeTeX mailing list