<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Howdy,<div><br></div><div>No guarantees but try using the -dNOSAFER option for gs. <br><br><div id="AppleMailSignature" dir="ltr">Good Luck,<div>Herb Schulz</div><div><br class="webkit-block-placeholder"></div></div><div dir="ltr"><br>On Dec 18, 2018, at 4:49 PM, Knut Petersen <<a href="mailto:Knut_Petersen@t-online.de">Knut_Petersen@t-online.de</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr">
  

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  
  
    <p>Hi everybody!</p>
    <p>I often write documents that mix text and music, a short example
      is given below:<br>
    </p>
    <blockquote>
      <p><tt>\NeedsTeXFormat{LaTeX2e}</tt><br>
        <tt>\documentclass[12pt]{letter}</tt><br>
        <tt>\usepackage{geometry}</tt><br>
        <tt>\geometry{papersize={14.85cm,21cm},noheadfoot,nomarginpar,</tt><br>
        <tt>          left=1.5cm,right=1.5cm,top=1.5cm,bottom=1.5cm}</tt><br>
        <tt>\usepackage{fontspec}</tt><br>
        <tt>\defaultfontfeatures{Ligatures=TeX}</tt><br>
        <tt>\setmainfont{cmunrm.otf}[BoldFont=cmunbx.otf,</tt><br>
        <tt>                         ItalicFont=cmunti.otf,</tt><br>
        <tt>                         BoldItalicFont=cmunbi.otf]</tt><br>
        <tt>\usepackage{lipsum} </tt><br>
        <tt>\usepackage{lyinla}</tt><br>
        <tt>\begin{document}</tt><br>
        <tt>\pagestyle{empty}</tt><br>
        <tt>\small\lipsum[1]</tt><br>
        <tt>{\bfseries O du fröhliche}\hspace{\fill}EG 44, 1-3\par</tt><br>
        <tt>\begin{lilyfrag}[staffsize=16.666,width=0.92\textwidth,smalllatexfont]</tt><br>
        <tt>  \include "<a href="http://deutsch.ly">deutsch.ly</a>"</tt><br>
        <tt>    \relative a' { </tt><br>
        <tt>      \key d \major</tt><br>
        <tt>      a2 h a4. g8 fis4 (g) \breathe a2 h a4. g8 fis4 (g)
          \breathe \break</tt><br>
        <tt>      a2 2 h cis4 d cis2 h a1</tt><br>
        <tt>    }</tt><br>
        <tt>    \addlyrics {</tt><br>
        <tt>      O du fröh -- li -- che, __ o du se -- li -- ge, __</tt><br>
        <tt>      gna -- den -- brin -- gen -- de Weih -- nachts --
          zeit!</tt><br>
        <tt>    }</tt><br>
        <tt>\end{lilyfrag}</tt><br>
        <tt>\lipsum[2]</tt><br>
        <tt>\end{document}</tt><br>
      </p>
    </blockquote>
    <p>The example above is intended to be translated with lualatex
      --shell-escape.</p>
    lyinla.sty provides the necessary code for the lilyfrag
    environement.<br>
    The text inside of a lilyfrag environment is extended and passed to
    the lilypond<br>
    music engraver. The result is a number of pdfs without any embedded<br>
    fonts, these pdf are included using \includegraphics. At the end of
    the lualatex<br>
    run (triggered by the stop_run callback) ghostscript is used to
    postprocess<br>
    the pdf generated by lualatex. A bit if postscript code provides the
    fonts to<br>
    ghostscript, the result is a final pdf that contains only one copy
    of every font<br>
    used in all the included pdfs, not one copy per usage of
    \includegraphics.<br>
    <p>Often the mechanism pointed out above reduces file size by more
      than 80 percent.</p>
    Unfortunately recent changes to ghostscript (commit 04a517f39cc)
    broke<br>
    that mechanism, and it's not the first time that changes to gs broke
    my code.<br>
    I'd prefer to have a lualatex (or pdflatex/xelatex) that would be
    able to detect<br>
    usage of unembedded normal and CID fonts in included pdfs and to
    embed<br>
    exactly one subsetted copy of all needed fonts in the output pdf.
    <p><br>
    </p>
    <p>Is there already a solution somewhere in the bit bucket? <br>
    </p>
    <p>If not: Do you think it is possible to extend lua/xe/pdflatex
      with reasonable effort?</p>
    <p>Knut<br>
    </p>
  

</div></blockquote></div></body></html>