Here are the changes that I did (but I have tested only with trunk, not 09.04):

framework/webapp/config/simhei.ttf
framework/webapp/config/simhei.xml

Index: framework/webapp/config/fop.xconf
===================================================================
--- framework/webapp/config/fop.xconf   (revision 935959)
+++ framework/webapp/config/fop.xconf   (working copy)
@@ -82,6 +82,14 @@
                           | 500 | 600 | 700 | 800 | 900
         (normal = 400, bold = 700)
         -->
+        <font metrics-url="simhei.xml" kerning="yes" embed-url="simhei.ttf">
+          <font-triplet name="SimHei" style="normal" weight="normal"/>
+          <font-triplet name="SimHei" style="normal" weight="bold"/>
+        </font>

Index: framework/common/widget/CommonScreens.xml
===================================================================
--- framework/common/widget/CommonScreens.xml   (revisione 929148)
+++ framework/common/widget/CommonScreens.xml   (copia locale)
@@ -373,8 +374,9 @@
                 <set field="layoutSettings.shortcutIcon" 
value="/images/ofbiz.ico" global="true"/>
                 <!-- The settings below are used for xsl-fo screens -->
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <set field="logoImageUrl" value="/images/ofbiz_logo.gif"/>
-                <!--<set field="defaultFontFamily" value="Arial"/>-->
+                <set field="defaultFontFamily" value="SimHei"/>
             </actions>
             <widgets>
                 <!-- render header -->
@@ -392,8 +394,9 @@
         <section>
             <actions>
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <set field="logoImageUrl" value="/images/ofbiz_logo.gif"/>
-                <!--<set field="defaultFontFamily" value="Arial"/>-->
+                <set field="defaultFontFamily" value="SimHei"/>
            </actions>
             <widgets>
                 <platform-specific><xsl-fo><html-template 
location="component://common/webcommon/includes/reportTemplate.fo.ftl"/></xsl-fo></platform-specific>

On Apr 22, 2010, at 3:32 AM, Koon Sang wrote:

> 
> Hello,
> 
> I managed to solve the mystery.  The problem is because OFBIZ does not load
> xalan-2.7.0.jar and serializer-2.7.0.jar during startup.  I added the jar
> files in the startup script via classpath but it does not work either. 
> Therefore, I modified org.ofbiz.base.start.Start to load all jar under
> ofbiz\framework\webapp\lib and it works.
> 
> Summary of how I made it work for me:
> 
> 1. Generate xml for the ttf I want (Refer to section on TrueType Font Metric
> at http://xmlgraphics.apache.org/fop/0.94/fonts.html)
> 2. Copy the xml and ttf to ofbiz\framework\webapp\config
> 3. Put the following in fop.xconf:
> 
>          <font-triplet name="SimHei" style="normal" weight="normal"/>
> 
> 4. In the *.fo.ftl, set font-family, e.g.:
> <fo:block font-size="5pt" font-family="SimHei"
> font-weight="bold">${product.internalName?if_exists}</fo:block>
> 
> Not sure whether I am doing the right thing or following the good practices,
> but it works for me.  Thanks for all the pointers, anyway.
> 
> -- 
> View this message in context: 
> http://n4.nabble.com/Multi-lingual-suport-for-FOP-in-OFBIZ-9-04-tp1934541p2019928.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.

Reply via email to