org.apache.fop.svg
Class PDFTextPainter

java.lang.Object
  extended byorg.apache.fop.svg.PDFTextPainter
All Implemented Interfaces:
TextPainter

public class PDFTextPainter
extends java.lang.Object
implements TextPainter

Renders the attributed character iterator of a TextNode.

Version:
$Id: PDFTextPainter.java,v 1.7.2.4 2003/02/25 15:08:11 jeremias Exp $
Author:
Keiron Liddle

Field Summary
protected static TextPainter PROXY_PAINTER
          Use the stroking text painter to get the bounds and shape.
 
Constructor Summary
PDFTextPainter(FontState fs)
           
 
Method Summary
 java.awt.geom.Rectangle2D getBounds2D(TextNode node)
           
 java.awt.geom.Rectangle2D getGeometryBounds(TextNode node)
           
 java.awt.Shape getHighlightShape(Mark beginMark, Mark endMark)
           
 Mark getMark(TextNode node, int pos, boolean all)
           
 java.awt.Shape getOutline(TextNode node)
           
 int[] getSelected(Mark start, Mark finish)
           
 float getStringWidth(java.lang.String str)
           
protected  java.lang.String getText(java.text.AttributedCharacterIterator aci)
           
 void paint(TextNode node, java.awt.Graphics2D g2d)
          Paints the specified attributed character iterator using the specified Graphics2D and context and font context.
protected  java.awt.geom.Point2D paintACI(java.text.AttributedCharacterIterator aci, java.awt.Graphics2D g2d, java.awt.geom.Point2D loc)
           
protected  java.awt.geom.Point2D paintTextRun(StrokingTextPainter.TextRun run, java.awt.Graphics2D g2d, java.awt.geom.Point2D loc)
           
protected  void paintTextRuns(java.util.List textRuns, java.awt.Graphics2D g2d, java.awt.geom.Point2D loc)
           
 Mark selectAll(double x, double y, TextNode node)
           
 Mark selectAt(double x, double y, TextNode node)
           
 Mark selectFirst(TextNode node)
           
 Mark selectLast(TextNode node)
           
 Mark selectTo(double x, double y, Mark beginMark)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROXY_PAINTER

protected static final TextPainter PROXY_PAINTER
Use the stroking text painter to get the bounds and shape. Also used as a fallback to draw the string with strokes.

Constructor Detail

PDFTextPainter

public PDFTextPainter(FontState fs)
Method Detail

paint

public void paint(TextNode node,
                  java.awt.Graphics2D g2d)
Paints the specified attributed character iterator using the specified Graphics2D and context and font context.

Specified by:
paint in interface TextPainter
Parameters:
node - the TextNode to paint
g2d - the Graphics2D to use

paintTextRuns

protected void paintTextRuns(java.util.List textRuns,
                             java.awt.Graphics2D g2d,
                             java.awt.geom.Point2D loc)

paintTextRun

protected java.awt.geom.Point2D paintTextRun(StrokingTextPainter.TextRun run,
                                             java.awt.Graphics2D g2d,
                                             java.awt.geom.Point2D loc)

getText

protected java.lang.String getText(java.text.AttributedCharacterIterator aci)

paintACI

protected java.awt.geom.Point2D paintACI(java.text.AttributedCharacterIterator aci,
                                         java.awt.Graphics2D g2d,
                                         java.awt.geom.Point2D loc)

getStringWidth

public float getStringWidth(java.lang.String str)

getMark

public Mark getMark(TextNode node,
                    int pos,
                    boolean all)
Specified by:
getMark in interface TextPainter

selectAt

public Mark selectAt(double x,
                     double y,
                     TextNode node)
Specified by:
selectAt in interface TextPainter

selectTo

public Mark selectTo(double x,
                     double y,
                     Mark beginMark)
Specified by:
selectTo in interface TextPainter

selectAll

public Mark selectAll(double x,
                      double y,
                      TextNode node)

selectFirst

public Mark selectFirst(TextNode node)
Specified by:
selectFirst in interface TextPainter

selectLast

public Mark selectLast(TextNode node)
Specified by:
selectLast in interface TextPainter

getSelected

public int[] getSelected(Mark start,
                         Mark finish)
Specified by:
getSelected in interface TextPainter

getHighlightShape

public java.awt.Shape getHighlightShape(Mark beginMark,
                                        Mark endMark)
Specified by:
getHighlightShape in interface TextPainter

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D(TextNode node)
Specified by:
getBounds2D in interface TextPainter

getGeometryBounds

public java.awt.geom.Rectangle2D getGeometryBounds(TextNode node)
Specified by:
getGeometryBounds in interface TextPainter

getOutline

public java.awt.Shape getOutline(TextNode node)
Specified by:
getOutline in interface TextPainter


Copyright ? 1999-2003 Apache Software Foundation. All Rights Reserved.