Bug 27727 - problem displaying Japanese fonts in PDF.
Summary: problem displaying Japanese fonts in PDF.
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: pdf (show other bugs)
Version: 0.15
Hardware: HP All
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-17 05:36 UTC by shyama
Modified: 2012-04-07 01:37 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description shyama 2004-03-17 05:36:19 UTC
I have a problem while rendering XML containing unicode characters into japanese
characters.

   I am working on Weblogic 8.1 on NT OS. When the font
file(Msmincho.ttf) is placed in c:/winnt/fonts
directory the rendering works fine and pdf is
generated with Japanese Characters. But when the ttf
file is place in a different folder I get the
following exception even though I have made an entry in basedir element of
userconfig file.

java.lang.NullPointerException
        at
org.apache.fop.render.pdf.fonts.LazyFont.getAscender(LazyFont.java:82)
        at
org.apache.fop.layout.FontState.getAscender(FontState.java:56)
        at
org.apache.fop.layout.LineArea.<init>(LineArea.java:111)
        at
org.apache.fop.layout.BlockArea.start(BlockArea.java:181)
        at
org.apache.fop.fo.flow.Block.layout(Block.java:251)
        at
org.apache.fop.fo.flow.TableCell.layout(TableCell.java:269)
        at
org.apache.fop.fo.flow.TableRow.layout(TableRow.java:344)
        at
org.apache.fop.fo.flow.TableBody.layout(TableBody.java:172)
        at
org.apache.fop.fo.flow.Table.layout(Table.java:247)
        at
org.apache.fop.fo.flow.Flow.layout(Flow.java:156)
        at
org.apache.fop.fo.flow.Flow.layout(Flow.java:113)
        at
org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:296)
        at
org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:200)
        at
org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:182)
        at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
        at
org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
        at
org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
        at
org.apache.xerces.parsers.XMLParser.parse(Unknown
Source)
        at
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
        at
org.apache.fop.apps.Driver.render(Driver.java:481)
        at
org.apache.fop.apps.Driver.run(Driver.java:554)
        at
com.db.eqr.ger.ui.web.company.pdf.GenerateMYPDF.createPDF(GenerateMYPDF.java:150)
        at
com.db.eqr.ger.ui.web.company.pdf.CompanyPDFAction.execute(CompanyPDFAction.java:146)
        at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:465)
        at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
        at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523)
        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
        at
weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)


Can anyone help me out and let me know what could be the problem here.

 I have used the following userconfig file.

<!--<!DOCTYPE configuration SYSTEM "config.dtd">-->
<!-- 
     this file contains templates which allow an user
easy 
     configuration of Fop. Actually normally you don't
need this configuration 
     file, but if you need to change configuration,
you should
     always use this file and *not* config.xml. 
     Usage: java org.apache.fop.apps.Fop -c
userconfig.xml -fo fo-file -pdf pdf-file
-->


<configuration>

<!--  NOT IMPLEMENTED
basedir: normally the base directory is the directory
where the fo file is 
         located. if you want to specify your own,
uncomment this entry
-->
  <entry>
    <key>baseDir</key>
    <value>c:/shyamajoshi/conf/fop</value>
  </entry>

<!--
************************************************************************
                        HYPHENATION 
************************************************************************
-->
  
<!--
   hyphenation directory 
   if you want to specify your own directory with
hyphenation pattern
   then uncomment the next entry and add the directory
name
-->

<!--
  <entry>
    <key>hyphenation-dir</key>
    <value>/java/xml-fop/hyph</value>
  </entry>
-->

<!--
************************************************************************
  Add fonts here
************************************************************************
-->

<fonts>
 <!-- example -->
 <!--
 <font metrics-file="arial.xml" kerning="yes"
embed-file="arial.ttf">
    <font-triplet name="Arial" style="normal"
weight="normal"/>
    <font-triplet name="ArialMT" style="normal"
weight="normal"/>
 </font>
 <font metrics-file="arialb.xml" kerning="yes"
embed-file="arialb.ttf">
    <font-triplet name="Arial" style="normal"
weight="bold"/>
    <font-triplet name="ArialMT" style="normal"
weight="bold"/>
 </font>
 <font metrics-file="ariali.xml" kerning="yes"
embed-file="ariali.ttf">
    <font-triplet name="Arial" style="italic"
weight="normal"/>
    <font-triplet name="ArialMT" style="italic"
weight="normal"/>
 </font>
 <font metrics-file="arialbi.xml" kerning="yes"
embed-file="arialbi.ttf">
    <font-triplet name="Arial" style="italic"
weight="bold"/>
    <font-triplet name="ArialMT" style="italic"
weight="bold"/>
 </font>
 -->
 <!-- Example Japanese fonts
 <font metrics-file="msgothic.xml"
embed-file="D:\winnt\font\msgothic.ttc" kerning="yes">
    <font-triplet name="Gothic" style="normal"
weight="normal"/>
    <font-triplet name="Gothic" style="normal"
weight="bold"/>
    <font-triplet name="Gothic" style="italic"
weight="normal"/>
    <font-triplet name="Gothic" style="italic"
weight="bold"/>
 </font>
 <font metrics-file="msmincho.xml"
embed-file="Cyberbit.ttf" kerning="yes">
    <font-triplet name="Mincho" style="normal"
weight="normal"/>
    <font-triplet name="Mincho" style="normal"
weight="bold"/>
    <font-triplet name="Mincho" style="italic"
weight="normal"/>
    <font-triplet name="Mincho" style="italic"
weight="bold"/>
   </font>
  -->
   <font metrics-file="msmincho.xml"
embed-file="msmincho.ttf" kerning="yes">
      <font-triplet name="MSMincho" style="normal"
weight="normal"/>
      <font-triplet name="MSMincho" style="normal"
weight="bold"/>
      <font-triplet name="MSMincho" style="italic"
weight="normal"/>
      <font-triplet name="MSMincho" style="italic"
weight="bold"/>
   </font>

  
</fonts>


</configuration>




Regards,
Shyama
Comment 1 Glenn Adams 2012-04-07 01:37:05 UTC
resetting severity from major to normal pending further review