ASF Bugzilla – Attachment 21775 Details for
Bug 44744
PDFGraphics2D.drawString(AttributedCharacterIterator it, float x, float y) throws NullPointerException
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
failing test
TestPDFGraphics.java (text/plain), 1.39 KB, created by
Yegor Kozlov
on 2008-04-03 02:20:12 UTC
(
hide
)
Description:
failing test
Filename:
MIME Type:
Creator:
Yegor Kozlov
Created:
2008-04-03 02:20:12 UTC
Size:
1.39 KB
patch
obsolete
>package com.yegor.fop; > >import org.apache.fop.svg.PDFDocumentGraphics2D; >import org.apache.xmlgraphics.java2d.GraphicContext; > >import java.io.FileOutputStream; >import java.text.AttributedString; >import java.awt.font.TextAttribute; >import java.awt.font.TextLayout; >import java.awt.*; > >/** > * PDFGraphics2D.drawString(AttributedCharacterIterator it, float x, float y) throws NullPointerException > * > * @author Yegor Kozlov > */ >public class TestPDFGraphics { > public static void main(String[] args) throws Exception { > PDFDocumentGraphics2D gr = new PDFDocumentGraphics2D(); > FileOutputStream out = new FileOutputStream("fop.pdf"); > gr.setupDocument(out, 792, 612); > > gr.setGraphicContext(new GraphicContext()); > > AttributedString str = new AttributedString("graphics.drawString(AttributedCharacterIterator it, float x, float y)"); > str.addAttribute(TextAttribute.FAMILY, "Helvetica"); > str.addAttribute(TextAttribute.SIZE, new Float(14)); > str.addAttribute(TextAttribute.FOREGROUND, Color.black); > > //drawing AttributedString via TextLayout works fine > TextLayout layout = new TextLayout(str.getIterator(), gr.getFontRenderContext()); > layout.draw(gr, 100, 100); > > //throws NullPointerException > gr.drawString(str.getIterator(), 100, 200); > > > gr.finish(); > out.close(); > > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 44744
: 21775