<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Zarathustra Shall Speak &#187; JasperReports</title>
	<atom:link href="http://zarathustrashallspeak.com/tag/jasperreports/feed/" rel="self" type="application/rss+xml" />
	<link>http://zarathustrashallspeak.com</link>
	<description>And you yourself are also this Will to Power.</description>
	<lastBuildDate>Tue, 13 Jul 2010 18:35:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>JasperReports, Tomcat and Fonts</title>
		<link>http://zarathustrashallspeak.com/2008/08/27/jasperreports-tomcat-and-fonts/</link>
		<comments>http://zarathustrashallspeak.com/2008/08/27/jasperreports-tomcat-and-fonts/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 10:43:55 +0000</pubDate>
		<dc:creator>Akairenn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JasperReports]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://zarathustrashallspeak.com/?p=34</guid>
		<description><![CDATA[I've seen things you people wouldn't believe...]]></description>
			<content:encoded><![CDATA[<p>One of our clients uses JasperReports, attached to a headless system running Tomcat and an interesting little module that ties things into a Drupal installation for remote interaction/management.   This is not the story of that Drupal module.</p>
<p>Rather, it&#8217;s a simple explanation about what needs to happen to use a new font with Jasper on a Linux system.  The client needed some new reports, and wanted a shiny new font to go with them.  After Googling for a bit on Jasper and fonts, no matter what I tried, I was greeted with the following:</p>
<p><code>net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font :<br />
pdfFontName   : RockwellStd<br />
pdfEncoding   : Cp1252<br />
isPdfEmbedded : false</code></p>
<p>RockwellStd was the font in question, by the way.  Right, well, using an external font is rather simple.  First, put the font somewhere.  Anywhere, really.</p>
<p>Then, just modify your report (.jrxml file) wherever you need to call the font:</p>
<p><code>&lt;font fontName="Verdana" pdfFontName="/opt/jdk1.6.0_03/jre/lib/fonts/RockwellStd.otf" size="10" isBold="false" isPdfEmbedded ="true"/&gt;</code></p>
<p>The important parts of this are <strong>pdfFontName</strong> and <strong>isPdfEmbedded</strong>.  pdfFontName should be the <em>entire path to the font, including the font&#8217;s filename</em>.  Then set isPdfEmbedded to true, since you&#8217;ll want the font embedded.</p>
<p>That&#8217;s it.  It&#8217;s stupidly simple, requires no messing about with installation of fonts on Linux, and puzzled me for far longer than I&#8217;d like to admit.</p>
]]></content:encoded>
			<wfw:commentRss>http://zarathustrashallspeak.com/2008/08/27/jasperreports-tomcat-and-fonts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
