Re: [XeTeX] Controlling font embedding in PDF output
>> 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? Yes. >> 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. Right now, ps2pdf is already able to merge the fonts used in LilyPond's PDFs. Together with the `extractpdfmark' tool (to preserve page mode, named destinations, etc.) our final PDFs are just fine. However, I would like to improve this further to handle the fonts in the XeTeX PDFs also. Werner -- Subscriptions, Archive, and List information, etc.: http://tug.org/mailman/listinfo/xetex
Re: [XeTeX] Controlling font embedding in PDF output
> I tried to look into the updmap manual and dvipdfmx manual but I > cannot find command-line od configuration options to do that. Yeah, I started with that :-) Werner -- Subscriptions, Archive, and List information, etc.: http://tug.org/mailman/listinfo/xetex
Re: [XeTeX] Controlling font embedding in PDF output
pá 16. 11. 2018 v 20:40 odesílatel Ross Moore napsal: > Hi Werner, > > On 17/11/2018, at 1:36, "Werner LEMBERG" 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 > -- Subscriptions, Archive, and List information, etc.: http://tug.org/mailman/listinfo/xetex
Re: [XeTeX] Controlling font embedding in PDF output
Hi Werner, On 17/11/2018, at 1:36, "Werner LEMBERG" 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. > > > Werner > Hope this helps. Ross -- Subscriptions, Archive, and List information, etc.: http://tug.org/mailman/listinfo/xetex
Re: [XeTeX] Controlling font embedding in PDF output
pá 16. 11. 2018 v 15:36 odesílatel Werner LEMBERG napsal: > > > > 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. > > 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). > I tried to look into the updmap manual and dvipdfmx manual but I cannot find command-line od configuration options to do that. > > > Werner > > > Zdeněk Wagner > http://ttsm.icpf.cas.cz/team/wagner.shtml > http://icebearsoft.euweb.cz > > > > > -- > Subscriptions, Archive, and List information, etc.: > http://tug.org/mailman/listinfo/xetex > -- Subscriptions, Archive, and List information, etc.: http://tug.org/mailman/listinfo/xetex
Re: [XeTeX] Controlling font embedding in PDF output
> > 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. 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). Werner -- Subscriptions, Archive, and List information, etc.: http://tug.org/mailman/listinfo/xetex