You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Jan Tosovsky <j....@email.cz> on 2017/01/08 21:31:26 UTC

Accessing glyph outline

Dear All,

I am trying to address https://issues.apache.org/jira/browse/FOP-2677 but I
realized there is no convenient method in FOPGVTGlyphVector.java which
stores/constructs glyph outline data.

The promising one getGlyphOutline() returns just glyph bounding box. I've
reported this as
https://issues.apache.org/jira/browse/FOP-2678

E.g. in Batik's SVGGVTGlyphVector all glyphs are stored as Glyph objects and
the outline can be accessed via glyph.getOutline(), see below:

    /**
     * Returns a Shape whose interior corresponds to the visual
representation
     * of the specified glyph within this GlyphVector.
     */
    public Shape getGlyphOutline(int glyphIndex) {
        if (glyphIndex < 0 || (glyphIndex > glyphs.length-1)) {
            throw new IndexOutOfBoundsException("glyphIndex: " + glyphIndex
            + ", is out of bounds. Should be between 0 and " +
(glyphs.length-1) + ".");
        }
        return glyphs[glyphIndex].getOutline();
    }

Any idea how to retrieve outlines for particular characters or entire text
chunks? It has to work even for not installed fonts (specified in the FOP
config).

Thanks,

Jan


RE: Accessing glyph outline

Posted by Jan Tosovsky <j....@email.cz>.
On 2017-01-08 Jan Tosovsky wrote:
> 
> I am trying to address https://issues.apache.org/jira/browse/FOP-2677
> but I realized there is no convenient method in FOPGVTGlyphVector.java 
> which stores/constructs glyph outline data.
> 
> The promising one getGlyphOutline() returns just glyph bounding box.
> I've reported this as
> https://issues.apache.org/jira/browse/FOP-2678

This is now covered by my patches 
https://issues.apache.org/jira/browse/FOP-2677
https://issues.apache.org/jira/browse/FOP-2678

Would it be possible to review, patch and copy newly built
fop-transcoder-allinone-svn-trunk.jar into the Batik's lib folder?

There are some Batik issues depending on this stuff.

Thanks!

Jan