0

I know this should be an easy thing, but when I try to generate a PCL document from an XML (via XSL), the Japanese characters show up really pixellated.

Apache FOP 1.0 Java 1.6.0_27

I've set up a userconfig.xml like so for pdf and this works fine:

<renderer mime="application/pdf">
  <fonts>
     <font metrics-url="IPAexGothic.xml" kerning="yes" embed-url="ipaexg.ttf">
       <font-triplet name="IPAexGothic" style="normal" weight="normal"/>
     </font>
  </fonts>
</renderer>

But I've read in the FOP documentation that fonts for PCL are a whole different ball game:

"Non-standard fonts for the PCL renderer are made available through the Java2D
subsystem  which means that you don't have to do any custom font configuration in this
case but you have to use the font names offered by Java."

I've tried to drop the fonts into my jre/lib/fonts/ directory. I've tried to set up logical fonts. ( http://docs.oracle.com/javase/tutorial/2d/text/fonts.html )

I created a program in AWT to try to display Japanese characters. They did not display either.

Is there something stupid that I am missing? Here are some Japanese characters if it helps. 東京都

Thanks, Joshua

  • Additionally, I've been looking at the PCL output on my local system, so I've eliminated the printer as the problem. Also, I've tried the additional configuration for PCL on FOP with no change: ( http://xmlgraphics.apache.org/fop/1.0/configuration.html ) – Joshua White Aug 15 '12 at 16:20

1 Answers1

1

As is often the case, once you take a really good crack at documenting your problem, you are often very close to a solution. To keep these unicode characters from being pixelated in PCL, you need to set the DPI in the FOP configuration to something much higher than the default 72 dpi. I set mine to 600 and the readability went way up.

<fop version="1.0">
  <source-resolution>600</source-resolution>
  <target-resolution>600</target-resolution>
  <renderers>
    <renderer mime="application/vnd.hp-PCL">
      <rendering>quality</rendering>
      <text-rendering>bitmap</text-rendering>
    </renderer>
  </renderers>
</fop>