You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Westemeyer, Sebastian, VF-DE" <Se...@vodafone.com> on 2004/10/07 16:30:57 UTC

Embedding fonts using fo2pdf serializer

Hi all!

I am working on an XSLT conversion to FO and a serialisation into PDF using the fo2pdf serializer. Now I have tried following the description on cocoon.apache.org to embed a simple Helvetica type of font into my document. By now I believe I have read everything there is on the web about the topic, probably it's only me being thick.

After extracting xml files from my TTFs, I tried a userconfig.xml which I pasted to the end of this mail.

My sitemap.xmap contains the following lines:
<map:serialize type="fo2pdf">
 <user-config>file:///f:/Projekte/095.115 IR-DB/cocoon-2.1.5.1/build/webapp/ir-db/resources/fop/fop-userconfig.xml</user-config>
</map:serialize>

I am getting loads of error messages like this one:

ERROR   2004-10-07 16:24:56.926 [sitemap.] (): unknown font hn-lc,normal,normal so defaulted font to any

The result is a PDF that sadly defaults to Times New Roman, despite all my efforts. I suspect that it has something to do with the config file, as the transformation works fine as long as I use FOP directly instead of cocoons (by the way: version 2.1) fo2pdf in the pipeline...

Any help is greatly appreciated!
Cheers,
 Sebastian


Attachment:
fop-userconfig.xml:
<configuration>

************************************************************************
                      SVG Text
************************************************************************
  <entry>
    <key>strokeSVGText</key>
    <value>false</value>
  </entry>

<!--
************************************************************************
  Add fonts here
************************************************************************
-->

<fonts>
 <font metrics-file="f:/Projekte/095.115 IR-DB/cocoon-2.1.5.1/build/webapp/ir-db/resources/fop/hllco.xml" kerning="yes" embed-file="f:/Projekte/095.115 IR-DB/cocoon-2.1.5.1/build/webapp/ir-db/resources/fop/hllco.ttf">
    <font-triplet name="hn-lc" style="normal" weight="normal"/>
    <font-triplet name="hn-lc" style="normal" weight="bold"/>
 </font>
 <font metrics-file="f:/Projekte/095.115 IR-DB/cocoon-2.1.5.1/build/webapp/ir-db/resources/fop/hlbc.xml" kerning="yes" embed-file="f:/Projekte/095.115 IR-DB/cocoon-2.1.5.1/build/webapp/ir-db/resources/fop/hlbc.ttf">
    <font-triplet name="hn-bc" style="normal" weight="normal"/>
    <font-triplet name="hn-bc" style="normal" weight="bold"/>
 </font>
</fonts>

</configuration>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Embedding fonts using fo2pdf serializer

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Westemeyer, Sebastian, VF-DE wrote:
> ERROR   2004-10-07 16:24:56.926 [sitemap.] (): unknown font hn-lc,normal,normal
...
>  <font metrics-file="f:/Projekte/095.115 IR-DB/cocoon-2.1.5.1/...

Note that metrics-file is an URL, not a file. Try prepending
"file:///". Probably the standalone FOP uses a different XML
parser which falls back to interpreting the string as pathname
if it gets an "invalid protocol scheme" exception.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org