xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Adams <gl...@skynav.com>
Subject Re: Apache FOP XML to PDF problem with CJK Unified Ideographs Extension B character
Date Sat, 17 Sep 2011 14:30:30 GMT
In general, FOP does not support the use of characters outside the Unicode
Base Multilingual Plane (BMP), i.e., characters whose scalar value is
greater than 65535 (decimal).

Support for extra-BMP Unicode codepoints will require an upgrade to the
current code base. As you can see by the error messages below, it is
attempting to treat individual UTF-16 surrogate pair codes as distinct code
points, and not as a UTF-16 encoding of an extra-BMP code point.

Regards,
Glenn

2011/9/16 BRUCE Y L LEE <brucelyl@gmail.com>

> 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