Hi Alexey,

Apologies for the slow reply. I'm just catching up on e-mail after the holidays.

On 28/12/2012 05:56, Alexey Neyman wrote:

Hi all,

As I mentioned in another email, I am trying to constrain FOP to use only local fonts (i.e. ones described in fop.cfg). For SVGs, I have a workaround:

- Generate fonts in SVG format using ttf2svg utility from Batik;

- Use an XSL stylesheet to embed all the fonts used by an SVG image into the image itself;

- Use such "preprocessed" SVG image as the input to FOP.


Interesting workaround. We are trying to tackle this issue by providing an alternative implementation of GVTFont in Batik that uses FOP's Font Library to load the font metrics.

This does not work well with JEuclid, though. When JEuclid generates SVG from MathML, it performs font rendering - that is, replaces characters by actual paths. And again, it uses system fonts, not the fonts available in FOP - even if running as FOP plugin.

To work around this issue for MathML, I am currently switching from JEuclid to pMML2SVG (http://pmml2svg.sourceforge.net). It generates SVGs with text characters, not paths. But in order to do so, it needs font metrics. Unfortunately, font metrics produced by stock FOP TTFReader are not sufficient - this stylesheet also needs bounding box for each glyph. To obtain these, pMML2SVG currently packages an augmented TTFReader Java sources which are to be compiled and used in lieu of the stock one.

Given that the patch is very small and as far as I can tell, compatible with current users of font metrics (it just adds 4 attributes to glyph description), is it possible to integrate this support into stock FOP?

Patch from pMML2SVG, slightly modified to apply to FOP 1.1 sources, attached.


Thanks for the patch. To get this added to the code base please raise an issue in JIRA, add the diff as an attachment and include [PATCH] in the subject line. A committer will then review the patch before applying it.

I know Peter Hancock is looking into doing something similar as he is working on getting Batik to use FOP configured fonts instead of the system ones. Peter mentioned to me offlist that he was going to need to expose a few extra things in TTFReader to facilitate this, could be you are covering similar ground here.

Anyway, please raise the JIRA issue otherwise your patch could get lost.

Thanks,

Chris

Regards,

Alexey.



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


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

Reply via email to