fop 1.0

org.apache.fop.svg
Class NativeTextPainter

java.lang.Object
  extended by org.apache.batik.gvt.renderer.BasicTextPainter
      extended by org.apache.batik.gvt.renderer.StrokingTextPainter
          extended by org.apache.fop.svg.NativeTextPainter
All Implemented Interfaces:
org.apache.batik.gvt.TextPainter
Direct Known Subclasses:
PDFFlowExtTextPainter, PDFFlowTextPainter, PSTextPainter

public abstract class NativeTextPainter
extends org.apache.batik.gvt.renderer.StrokingTextPainter

Abstract base class for text painters that use specialized text commands native to an output format to render text.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.batik.gvt.renderer.StrokingTextPainter
org.apache.batik.gvt.renderer.StrokingTextPainter.TextRun
 
Nested classes/interfaces inherited from class org.apache.batik.gvt.renderer.BasicTextPainter
org.apache.batik.gvt.renderer.BasicTextPainter.BasicMark
 
Field Summary
protected  FontInfo fontInfo
          the font collection
protected  org.apache.commons.logging.Log log
          the logger for this class
 
Fields inherited from class org.apache.batik.gvt.renderer.StrokingTextPainter
ADJUST_ALL, ADJUST_SPACING, ALT_GLYPH_HANDLER, ANCHOR_TYPE, BIDI_LEVEL, FLOW_PARAGRAPH, FLOW_REGIONS, GVT_FONT, GVT_FONTS, PAINT_INFO, singleton, TEXT_COMPOUND_ID, TEXTPATH, WRITING_MODE, WRITING_MODE_RTL, WRITING_MODE_TTB, XPOS, YPOS
 
Fields inherited from class org.apache.batik.gvt.renderer.BasicTextPainter
aaOffFontRenderContext, fontRenderContext
 
Constructor Summary
NativeTextPainter(FontInfo fontInfo)
          Creates a new instance.
 
Method Summary
protected  java.lang.CharSequence collectCharacters(java.text.AttributedCharacterIterator runaci)
          Collects all characters from an AttributedCharacterIterator.
protected  Font[] findFonts(java.text.AttributedCharacterIterator aci)
          Finds an array of suitable fonts for a given AttributedCharacterIterator.
protected abstract  boolean isSupported(java.awt.Graphics2D g2d)
          Indicates whether the given Graphics2D instance if compatible with this text painter implementation.
protected  void logCharacter(char ch, org.apache.batik.gvt.text.TextSpanLayout layout, int index, boolean visibleChar)
           
protected  void logTextRun(java.text.AttributedCharacterIterator runaci, org.apache.batik.gvt.text.TextSpanLayout layout)
           
protected abstract  void paintTextRun(org.apache.batik.gvt.renderer.StrokingTextPainter.TextRun textRun, java.awt.Graphics2D g2d)
          Paints a single text run.
protected  void paintTextRuns(java.util.List textRuns, java.awt.Graphics2D g2d)
          
 
Methods inherited from class org.apache.batik.gvt.renderer.StrokingTextPainter
adjustChunkOffsets, computeTextRuns, createModifiedACIForFontMatching, getBounds2D, getDecorationOutline, getDecorationStrokeOutline, getHighlightShape, getInstance, getMark, getOutline, getSelected, getTextChunk, getTextChunkACIs, getTextRuns, hitTest, paint, paintDecorations, printAttrs, selectFirst, selectLast
 
Methods inherited from class org.apache.batik.gvt.renderer.BasicTextPainter
getGeometryBounds, getTextLayoutFactory, selectAt, selectTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log
the logger for this class


fontInfo

protected final FontInfo fontInfo
the font collection

Constructor Detail

NativeTextPainter

public NativeTextPainter(FontInfo fontInfo)
Creates a new instance.

Parameters:
fontInfo - the font collection
Method Detail

isSupported

protected abstract boolean isSupported(java.awt.Graphics2D g2d)
Indicates whether the given Graphics2D instance if compatible with this text painter implementation.

Parameters:
g2d - the instance to check
Returns:
true if the instance is compatible.

paintTextRun

protected abstract void paintTextRun(org.apache.batik.gvt.renderer.StrokingTextPainter.TextRun textRun,
                                     java.awt.Graphics2D g2d)
                              throws java.io.IOException
Paints a single text run.

Parameters:
textRun - the text run
g2d - the target Graphics2D instance
Throws:
java.io.IOException - if an I/O error occurs while rendering the text

paintTextRuns

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

Overrides:
paintTextRuns in class org.apache.batik.gvt.renderer.StrokingTextPainter

findFonts

protected Font[] findFonts(java.text.AttributedCharacterIterator aci)
Finds an array of suitable fonts for a given AttributedCharacterIterator.

Parameters:
aci - the character iterator
Returns:
the array of fonts

collectCharacters

protected java.lang.CharSequence collectCharacters(java.text.AttributedCharacterIterator runaci)
Collects all characters from an AttributedCharacterIterator.

Parameters:
runaci - the character iterator
Returns:
the characters

logTextRun

protected final void logTextRun(java.text.AttributedCharacterIterator runaci,
                                org.apache.batik.gvt.text.TextSpanLayout layout)

logCharacter

protected final void logCharacter(char ch,
                                  org.apache.batik.gvt.text.TextSpanLayout layout,
                                  int index,
                                  boolean visibleChar)

fop 1.0

Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.