cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob Cantwell" <>
Subject RE: Cocoon, Fop, and embedded Truetype fonts
Date Sun, 07 Oct 2001 23:50:19 GMT
howdy brad,

embedding .ttfs in FOP with C2 does work. there is a page on
about this:

but here is my rough guide anyway:

i was able to install .ttfs in c2 but not c1, my biggest problems were
finding a good font and fop's funny way of referencing fonts in the
userconfig.xml file.

1) build your metric files with the help of the fonts support page at

2) in your sitemap serializer section add:

<map:serializer name="fo2pdf"
  <user-config src="d:/fop/conf/userconfig.xml"/>

3) In the userconfig.xml file, add entries such as these below. MSMINCHO.TTF
and PMINGLIU.TTF are free fonts with windows that work well. I had some
problems with free downloaded fonts. I also found that C2 wasn't actually
finding the fonts unless I put them in the folder where I started my JVM, in
my case my tomcat/bin directory. The C2 log files will tell you if it can't
find the fonts.  Reading the above link in 1) I see that you can use
absolute URLs to. (You might have to delete your tomcat working directory if
you modify this file.)

  <!-- japanese font -->
  <font metrics-file="MSMINCHO.xml" kerning="yes" embed-file="MSMINCHO.TTF">
    <font-triplet name="MSMincho" style="normal" weight="normal"/>
  <!-- chinese font -->
  <font metrics-file="PMINGLIU.xml" kerning="yes" embed-file="PMINGLIU.TTF">
    <font-triplet name="PMingLiU" style="normal" weight="normal"/>

4) also XML files have different encoding standards for different languages.
eg Chinese uses: <?xml version="1.0" encoding="gb2312"?> so you may need to
look into this if your characters aren't showing up.

i had an easier time embedding adobe .pfm fonts, but the .ttf did embed in
the end and then i did a little scooby dance!

i think thats it. cheers,

<!-- ====== built-with="Xalan" ===== -->
<name>     Jacob Cantwell   </name>
<company>  WebMCQ Pty. Ltd. </company>
<website> </website>

-----Original Message-----
Sent: Sunday, 7 October 2001 6:27 PM
To: Jacob Cantwell
Subject: Cocoon, Fop, and embedded Truetype fonts

Hi -

I saw that you posted to one of the Cocoon lists.  I've been struggling to
get cocoon
to embed Truetype fonts in the PDFs it produces.  I've been looking around,
haven't seen any clear indications that anyone has it working.  I was just
if you've had any luck yet.

--Brad Berkland (
  Scandinavian Studies

View raw message