You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Deryl Seale <de...@intel-assess.com> on 2007/06/05 15:01:00 UTC

Help with MathML/JEuclid

Hello, everyone.  Apologies in advance if this has been answered  
elsewhere, but I have not been able to find a solution to my issue.

I am trying to render PDF content that contains embedded MathML, a  
sample of which is contained in the message below.  I found the  
JEuclid plugin, and have successfully integrated it with Apache FOP  
such that my MathML contained in instream-foreign-object blocks gets  
passed to the plugin -- the MathML is being rendered by JEuclid,  
albeit improperly.  The issue I have seems to be with fonts; many of  
the valid escape sequences (e.g. &#8722;) get rendered as #  
characters, as if the FOP renderer encountered a character that was  
not in the font family it was using.  If I pass the exact same  
sample.fo file to the JEuclid MathViewer application at the following  
link (requires JDK 1.5 Web Start to run):

http://jeuclid.sourceforge.net/jeuclid-webstart/mathviewer.jnlp

.. the math renders perfectly.  I have tried registering the JEuclid  
recommended fonts (e.g. DejaVu) with the FOP renderer, and while the  
fonts for the body text do change, the equation remains unchanged.  I  
am not sure if this is an issue with the configuration for FOP or  
JEuclid -- the latter is pretty sparse -- so I am hoping someone has  
encountered this issue and might be able to give me some pointers.


-- 
Deryl Seale -- Director of Engineering
c: 734.883.9636
deryl.seale@intel-assess.com
www.intel-assess.com


-=-=-=-=-=-=-=-=- SAMPLE FO -=-=-=-=-=-=-=-=-

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:m="http:// 
www.w3.org/1998/Math/MathML">
     <fo:layout-master-set>
         <fo:simple-page-master master-name="only">
             <fo:region-body region-name="xsl-region-body"  
margin="0.7in"/>
             <fo:region-before region-name="xsl-region-before"  
extent="0.7in" display-align="before"/>
             <fo:region-after region-name="xsl-region-after" display- 
align="after" extent="0.7in"/>
         </fo:simple-page-master>
     </fo:layout-master-set>
     <fo:page-sequence master-reference="only">
         <fo:flow flow-name="xsl-region-body">
             <fo:block>
         A sample equation:
         <fo:instream-foreign-object>
         <m:math>
         <m:mrow>
           <m:mrow>
             <m:mo>(</m:mo>
             <m:mrow>
               <m:mn>6</m:mn>
               <m:msup>

                 <m:mi>y</m:mi>
                 <m:mn>3</m:mn>
               </m:msup>
               <m:mo>+</m:mo>
               <m:mn>2</m:mn>
               <m:msup>
                 <m:mi>y</m:mi>

                 <m:mn>2</m:mn>
               </m:msup>
               <m:mo>&#8722;</m:mo>
               <m:mi>y</m:mi>
               <m:mo>&#8722;</m:mo>
               <m:mn>12</m:mn>

             </m:mrow>
             <m:mo>)</m:mo>
           </m:mrow>
	</m:mrow>
       </m:math>
       </fo:instream-foreign-object>
             </fo:block>
         </fo:flow>
     </fo:page-sequence>
</fo:root>




Re: Help with MathML/JEuclid

Posted by Deryl Seale <de...@intel-assess.com>.
> Are you sure the font used for the text really is DejaVu (check the
> properties of the PDF file in your viewer)?

Yes, I am fairly certain it's DejaVu -- it visibly changes to what  
I'd expect the font to look like, and upon inspection in the file  
properties, I see the DejaVu font listed along with the other Acrobat  
internal fonts.  Is there anything else I need to do to get JEuclid  
working besides installing the plugin, registering the proper font  
family with FOP, and making sure my FO input XML is properly set up?

Has anyone else successfully run the JEuclid plugin?

> Have you tried the jeuclid-user mailing list?

I will try them now, though it looks like a low traffic list.

thanks.
--Deryl


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Help with MathML/JEuclid

Posted by Vincent Hennebert <vi...@anyware-tech.com>.
Hi Deryl,

Deryl Seale a écrit :
> Hello, everyone.  Apologies in advance if this has been answered
> elsewhere, but I have not been able to find a solution to my issue.
> 
> I am trying to render PDF content that contains embedded MathML, a
> sample of which is contained in the message below.  I found the JEuclid
> plugin, and have successfully integrated it with Apache FOP such that my
> MathML contained in instream-foreign-object blocks gets passed to the
> plugin -- the MathML is being rendered by JEuclid, albeit improperly. 
> The issue I have seems to be with fonts; many of the valid escape
> sequences (e.g. &#8722;) get rendered as # characters, as if the FOP
> renderer encountered a character that was not in the font family it was
> using.  If I pass the exact same sample.fo file to the JEuclid
> MathViewer application at the following link (requires JDK 1.5 Web Start
> to run):
> 
> http://jeuclid.sourceforge.net/jeuclid-webstart/mathviewer.jnlp
> 
> .. the math renders perfectly.  I have tried registering the JEuclid
> recommended fonts (e.g. DejaVu) with the FOP renderer, and while the
> fonts for the body text do change, the equation remains unchanged.  I am
> not sure if this is an issue with the configuration for FOP or JEuclid
> -- the latter is pretty sparse -- so I am hoping someone has encountered
> this issue and might be able to give me some pointers.

This is strange. If the aspect of the body text changes, I assume you
properly configured the DejaVu fonts for FOP and didn't forget to
specify the config file on the command line:
fop -c config.xml math.fo math.pdf
Are you sure the font used for the text really is DejaVu (check the
properties of the PDF file in your viewer)?
Have you tried the jeuclid-user mailing list?


HTH,
Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org