https://issues.apache.org/bugzilla/show_bug.cgi?id=44744
Summary: PDFGraphics2D.drawString(AttributedCharacterIterator it,
float x, float y) throws NullPointerException
Product: Fop
Version: all
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: pdf
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
PDFGraphics2D.drawString(AttributedCharacterIterator it, float x, float y)
throws NullPointerException:
Exception in thread "main" java.lang.NullPointerException
at org.apache.fop.svg.PDFGraphics2D.drawString(PDFGraphics2D.java:1559)
at
org.apache.xmlgraphics.java2d.AbstractGraphics2D.drawString(AbstractGraphics2D.java:652)
at com.yegor.fop.TestPDFGraphics.main(TestPDFGraphics.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
A failing test is attached.
It looks like drawString(AttributedCharacterIterator it, float x, float y) is
not finished. The variable fontState which results in NPE is assigned to null
and never initialized.
If possible, I'd like to have it fixed in FOP 0.95. I would be happy to upload
a patch but my knowledge of PDF is not enough for that :). Please suggest how
it can be fixed.
Shouldn't this method be re-written so that drawString(String str, float x,
float y) is called for each individual text run in the AttributedString? If so,
how can I measure the length of a text run and advance the x co-ordinate?
Regards,
Yegor
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.