metanorma / mn2pdf

Metanorma XML to PDF
3 stars 2 forks source link

jEuclid improvements #117

Open Intelligent2013 opened 2 years ago

Intelligent2013 commented 2 years ago

Sometimes jEuclid renders mathml into SVG images badly: image (Source issue: https://github.com/metanorma/iso-10303-detached-docs/issues/107).

Currently, these issues fixed on-fly in xslt by applying zero-width spaces, left/right indents, etc. Need to investigate how fix them in jEuclid directly.

jEuclid repository: https://github.com/rototor/jeuclid

Intelligent2013 commented 1 year ago

From https://github.com/metanorma/metanorma-ogc/issues/465#issuecomment-1366775899:

Mathml text (see line numbers) renders a bolded than main text: image

Intelligent2013 commented 1 year ago

Mathml text (see line numbers) renders a bolded than main text:

This is not jEuclid, Batik or FOP issue. Actually Acrobat renders text and SVG graphic with different anti-aliasing algorithms. There isn't different in scale 600%.

Note: 1st digit is text, 2nd digit is mathml (SVG).

Acrobat rendering:

Rendering in PDF XChange Viewer:

Rendering in Chrome browser: -scale 100% - no difference image

Intelligent2013 commented 1 year ago

From http://www.xmlmind.com/xmleditor/addons_doc.html:

This plug-in, previous called "JEuclid MathML / ODF image plug-in", has been created by Max Berger who is also the maintainer of JEuclid.

As of version 3.0.1_01, the name of this plug-in becomes "JEuclid image toolkit plug-in" and its code is maintained by XMLmind.

This plug-in is released under the same license as JEuclid: Apache Software License Version 2.0.

The source code of this plug-in, as well as an ant build.xml file allowing to rebuild jeuclid_imagetoolkit.jar, are found in jeuclid_addon_install_dir/src.zip.

Modifications made by XMLmind Software Note that JEuclid has been modified by XMLmind Software in order to recompile it against latest versions of Apache FOP and Apache Batik. More information in jeuclid_addon_install_dir/CHANGES_MADE_BY_XMLMIND.txt.

http://www.xmlmind.com/xmleditor/addons.shtml#imageToolkitPlugin

ronaldtse commented 1 year ago

@Intelligent2013 I am wondering if we should change the text rendering inside JEuclid with actual math fonts. I suspect that math SVGs are causing the PDF sizes to increase by a significant amount.