[XeTeX] Controlling font embedding in PDF output

Zdenek Wagner zdenek.wagner at gmail.com
Fri Nov 16 21:46:42 CET 2018


pá 16. 11. 2018 v 20:40 odesílatel Ross Moore <ross.moore at mq.edu.au> napsal:

> Hi Werner,
>
> On 17/11/2018, at 1:36, "Werner LEMBERG" <wl at gnu.org> wrote:
>
> >
> > > > Is there a simple option to make XeTeX (or rather xdvipdfmx) not
> > > > embed fonts in PDFs? I'm going to post-process the output, which
> > > > will do the embedding.
> > >
> > > Perhaps it is easier to generate the PDF, then remove the embedded
> > > fonts?
> >
> > Not for my use case, which is to include many PDFs (generated by
> > LilyPond) into a master PDF (generated by XeLaTeX). The
> > post-processor (Ghostscript's ps2pdf script) should then compute
> > subsetted fonts for the whole document, which can make the final PDF
> > *a lot* smaller in comparison to the standard way because subsetted
> > fonts usually can't be merged.
>
> Are you sure that this is even feasible, in that the same characters are
> referred to in the same way, in each of the Lilypond PDFs?
>
> If the fonts are all Type1, with the same encodings in each PDF, this
> would be OK.
> But I've seen PDFs where the subsetting of Type0 or TTF fonts is as an
> array, which simply assigns a number to the used glyphs, perhaps in the
> order of first occurrence within the PDF. These certainly cannot be merged,
> without adjusting essentially every string in every embedded PDF.
>
> >
> > In LilyPond I can control whether its output PDF gets generated
> > (1) the usual way (using subsetted fonts), (2) with embedded but not
> > subsetted fonts, or (3) without embedded fonts. Ideally, I want
> > option (3) for XeTeX (and for pdfTeX and luatex also, BTW). If this
> > isn't possible, I would like to enforce option (2) so that ps2pdf can
> > still do a decent job (at the cost of larger intermediate PDFs).
>
> If you can get this to work, I'd be very interested in the technique.
> Otherwise, a possible alternative approach is to combine the PDFs into a
> single Portfolio, using Adobe's Acrobat Pro. However I'd doubt that this
> gives any saving in file size over inclusion as attachments.
>
> Several years ago I combined PDF files several times, I used
\includegraphics from the graphicx package because in addition I had to
reorder the pages and reduce their sizes. As a result I got huge PDF which
was ten times larger than the sum of the sources. Afterwards I opened it in
Adobe Acrobat Pro v9 and just saved it. The size of the resulting PDF was
approcimately 10% of the huge PDF. Thus Acrobat can recognize that each
page embeds its own copy of the same font and unite them with subsetting
properly handled. Of course it depends on the file, it is possible that my
files were somewhat special.

Zdeněk Wagner
http://ttsm.icpf.cas.cz/team/wagner.shtml
http://icebearsoft.euweb.cz




> >
> >
> > Werner
> >
>
> Hope this helps.
>
> Ross
>
>
>
>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>   http://tug.org/mailman/listinfo/xetex
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/xetex/attachments/20181116/791807b8/attachment.html>


More information about the XeTeX mailing list