xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BRUCE Y L LEE <bruce...@gmail.com>
Subject Apache FOP XML to PDF problem with CJK Unified Ideographs Extension B character
Date Fri, 16 Sep 2011 09:13:57 GMT
Hi

I would like to transform XML to PDF using Apache FOP.
CJK Unified Ideographs Extension B characters is included in the XML (e.g.
&#x20000;), I had add the font "Simsun (Founder Extended)" for Apache FOP
but it cannot render the CJK Unified Ideographs Extension B characters,
please help.

CJK_ExtB.xml
[code]
<CJK_ExtB>&#x20000;</CJK_ExtB>
[/code]

CJK_ExtB_FO.xsl
[code]
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" xmlns:fo="
http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="A4" page-height="29.7cm"
page-width="21.0cm" margin="2cm">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4">
<fo:flow flow-name="xsl-region-body">
<fo:block font-family="Simsun (Founder Extended)">測試<xsl:value-of
select="CJK_ExtB"/>測試</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
[/code]

fop.xconf
[code]
<renderer mime="application/pdf">
  <filterList>
<value>flate</value>
  </filterList>
  <fonts>
<font metrics-url="file:///D:/fop-1.0/Fonts/SURSONG.xml" kerning="yes"
embed-url="file:///D:/fop-1.0/fonts/SURSONG.ttf">
<font-triplet name="Simsun (Founder Extended)" style="normal"
weight="normal"/>
<font-triplet name="Simsun (Founder Extended)" style="normal"
weight="bold"/>
<font-triplet name="Simsun (Founder Extended)" style="italic"
weight="normal"/>
<font-triplet name="Simsun (Founder Extended)" style="italic"
weight="bold"/>
</font>
  </fonts>
</renderer>
[/code]

cmd
[code]
D:\fop-1.0>fop -c conf\fop.xconf -xml CJK_ExtB.xml -xsl CJK_ExtB_FO.xsl -pdf
CJK_ExtB.pdf
9月 15, 2011 2:32:20 下午 org.apache.fop.apps.FopFactoryConfigurator configure
INFO: Default page-height set to: 11in
9月 15, 2011 2:32:20 下午 org.apache.fop.apps.FopFactoryConfigurator configure
INFO: Default page-width set to: 8.26in
9月 15, 2011 2:32:23 下午 org.apache.fop.events.LoggingEventListener
processEvent WARNING: Glyph "?" (0xd840) not available in font
"FZSY--SURROGATE-0".
9月 15, 2011 2:32:23 下午 org.apache.fop.events.LoggingEventListener
processEvent WARNING: Glyph "?" (0xdc00) not available in font
"FZSY--SURROGATE-0".
[/code]


Regards,
Bruce

Mime
View raw message