xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pascal Sancho <psancho....@gmail.com>
Subject Re: SingleByteFont Patch
Date Tue, 01 Jul 2014 11:43:32 GMT
Hi,
can you file in entries in Jira, please?
see our HowTo [1] submitting patches.

[1] http://xmlgraphics.apache.org/fop/dev/#patches

2014-07-01 12:36 GMT+02:00 Kai Hofmann <powerstat@web.de>:
>
> Dear all,
>
> looks like there is another bug based on the before mentioned problem:
>
> FOPGVTGlyphVector:
>
>    private void buildBoundingBoxes() {
>         boundingBoxes = new Rectangle2D[glyphs.length];
>         for (int i = 0; i < glyphs.length; i++) {
>             Rectangle bbox = fontMetrics.getBoundingBox(glyphs[i], fontSize);
>             boundingBoxes[i] = new Rectangle2D.Float(bbox.x / 1000000f, -(bbox.y + bbox.height)
/ 1000000f,
>                     bbox.width / 1000000f, bbox.height / 1000000f);
>         }
>     }
>
>
> Here the result of the patched getBoundingBox seems to be used without a null pointer
check. Please keep attention on getBoundingBox which explizitly returns null !!!!
> Looks like it would help to have complete javadocs which describe the possible return
values to avoid such mistakes.
>
>
> Gesendet: Dienstag, 01. Juli 2014 um 10:52 Uhr
> Von: "Kai Hofmann" <powerstat@web.de>
> An: fop-users@xmlgraphics.apache.org
> Betreff: SingleByteFont Patch
> Dear all,
>
> I found a small bug in SingleByteFont - please see attached patch - in getBoundingBox:
>
> if (idx >= 0 && idx < boundingBoxes.length)
>
> might result in a null pointer exception, when getBoundingBox is called before setBoudning
box.
> So repleace with:
>
> if (boundingBoxes != null && idx >= 0 && idx < boundingBoxes.length)


-- 
pascal

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


Mime
View raw message