title: Apache FOP | custom fonts | relative URL not working
body: <p>I have got configuration file to load custom fonts for Apache FOP. I am struggling to configure embed-url on server so that font url changes as per server domain. </p>
  
  <p>I have tried embed-url property value as:</p>
  
  <p><strong>Non working embed-urls:</strong></p>
  
  <ul>
  <li>embed-url="context:/etc/designs/projectName/clientlibs/pdffonts/Batang.ttf"</li>
  <li>embed-url="file:/etc/designs/projectName/clientlibs/pdffonts/Batang.ttf"</li>
  </ul>
  
  <p><strong>Working embed-url:</strong></p>
  
  <ul>
  <li>embed-url="http://localhost:4503/etc/designs/projectName/clientlibs/pdffonts/Batang.ttf"</li>
  </ul>
  
  <p>Somehow I can't seems to find proper syntax here. I am using FOP with AEM 6.0.</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;fop version="1.0"&gt;
      &lt;renderers&gt;
          &lt;renderer mime="application/pdf"&gt;
              &lt;fonts&gt;
                  &lt;font kerning="yes"
                      embed-url="context:/etc/designs/projectName/clientlibs/pdffonts/Batang.ttf" -- this doesn't
                      embedding-mode="subset"&gt;
                      &lt;font-triplet name="SimSun" style="normal" weight="normal" /&gt;
                  &lt;/font&gt;
                  &lt;font kerning="yes"
                      embed-url="file:/etc/designs/projectName/clientlibs/pdffonts/Batang.ttf" -- this doesn't
                      embedding-mode="subset"&gt;
                      &lt;font-triplet name="Batang" style="normal" weight="normal" /&gt;
                  &lt;/font&gt;
                  &lt;font kerning="yes"
                      embed-url="http://localhost:4503/etc/designs/projectName/clientlibs/pdffonts/Batang.ttf" -- this works
                      embedding-mode="subset"&gt;
                      &lt;font-triplet name="Batang" style="normal" weight="normal" /&gt;
                  &lt;/font&gt;
              &lt;/fonts&gt;
          &lt;/renderer&gt;
      &lt;/renderers&gt;
  &lt;/fop&gt;
  </code></pre>