org.apache.fop.svg
Class PDFTextPainter

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

public class PDFTextPainter
extends 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
 Rectangle2D getBounds2D(TextNode node)
           
 Rectangle2D getGeometryBounds(TextNode node)
           
 Shape getHighlightShape(Mark beginMark, Mark endMark)
           
 Mark getMark(TextNode node, int pos, boolean all)
           
 Shape getOutline(TextNode node)
           
 int[] getSelected(Mark start, Mark finish)
           
 float getStringWidth(String str)
           
protected  String getText(AttributedCharacterIterator aci)
           
 void paint(TextNode node, Graphics2D g2d)
          Paints the specified attributed character iterator using the specified Graphics2D and context and font context.
protected  Point2D paintACI(AttributedCharacterIterator aci, Graphics2D g2d, Point2D loc)
           
protected  Point2D paintTextRun(StrokingTextPainter.TextRun run, Graphics2D g2d, Point2D loc)
           
protected  void paintTextRuns(List textRuns, Graphics2D g2d, 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,
                  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
context - the rendering context.

paintTextRuns

protected void paintTextRuns(List textRuns,
                             Graphics2D g2d,
                             Point2D loc)

paintTextRun

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

getText

protected String getText(AttributedCharacterIterator aci)

paintACI

protected Point2D paintACI(AttributedCharacterIterator aci,
                           Graphics2D g2d,
                           Point2D loc)

getStringWidth

public float getStringWidth(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 Shape getHighlightShape(Mark beginMark,
                               Mark endMark)
Specified by:
getHighlightShape in interface TextPainter

getBounds2D

public Rectangle2D getBounds2D(TextNode node)
Specified by:
getBounds2D in interface TextPainter

getGeometryBounds

public Rectangle2D getGeometryBounds(TextNode node)
Specified by:
getGeometryBounds in interface TextPainter

getOutline

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


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