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.
Greetings
Kai Hofmann
--
Kai Hofmann EMail: [email protected]
Bremen/Germany
Gesendet: Dienstag, 01. Juli 2014 um 10:52 Uhr
Von: "Kai Hofmann" <[email protected]>
An: [email protected]
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)
Greetings
Kai Hofmann
--
Kai Hofmann EMail: [email protected]
Bremen/Germany
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]