Docbook, Maven, SVG and fonts

October 5, 2009 | In Uncategorized |

I wrote in my last post about using Maven to build good-looking and maintainable documentation. I had issues with raster images getting rendered in the wrong resolution with Apache FOP. I tried RenderX XEP and it rendered in the correct resolution, but the images still look a bit blurred in the resulting PDF. Also the personal edition adds a footer on every page. Side note: I don’t mind paying for software, but it is always a hassle with license files and registrations. The benefits must be big for me to include a tool like this in my toolbox.

SVG

Since raster images was problematic I thought about using a vector format instead. I used OmniGraffle Professional to generate SVG illustrations. OmniGraffle is a really nice program. This worked pretty well with FOP (it is using Apache Batik behind the scene, I think). But I could not get font rendering to work inside SVG. It is replacing the fonts I used with Times.

I have set up FOP to use some fonts I like. It looks like this in the pom.xml:

<font>
  <name>FrutigerLinotype-Roman</name>
  <style>normal</style>
  <weight>normal</weight>
  <embedFile>${basedir}/src/fonts/frutiger.ttf</embedFile>
  <metricsFile>${basedir}/target/fonts/frutiger-metrics.xml</metricsFile>
</font>

In the SVG I used the same fonts and font names. A wierd thing s that it works fine when I used Batik in form of Squiggle, which is a Swing SVG viewer, written with Batik.

With XEP the result was worse. It lost gradients and some other artifacts from the SVG. No on the other hand, it actually found the fonts. So again XEP and Apache FOP had different problems. I don’t think XEP is using Batik to render the SVG into PDF.

Current state of “Documentation Nirvana”

  • Tool chain is working good. Maven was a big win. Self contained project , easy to check out from Mercurial and just run.
  • Raster images looks wierd in all my tests. This is almost a show stopper. Screenshots are necessary in my documents.
  • Vector images work better. If I stick to Helvetica I think it is good enough.

I would welcome comments!

No Comments yet »

RSS feed for comments on this post.

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Entries and comments feeds. Valid XHTML and CSS. ^Top^