Package org.apache.fop.svg
Class NativeTextPainter
java.lang.Object
org.apache.batik.bridge.BasicTextPainter
org.apache.batik.bridge.StrokingTextPainter
org.apache.fop.svg.NativeTextPainter
- All Implemented Interfaces:
org.apache.batik.bridge.TextPainter
- Direct Known Subclasses:
PDFFlowExtTextPainter
,PDFFlowTextPainter
,PSTextPainter
public abstract class NativeTextPainter
extends org.apache.batik.bridge.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.bridge.StrokingTextPainter
org.apache.batik.bridge.StrokingTextPainter.TextChunk, org.apache.batik.bridge.StrokingTextPainter.TextRun
Nested classes/interfaces inherited from class org.apache.batik.bridge.BasicTextPainter
org.apache.batik.bridge.BasicTextPainter.BasicMark
-
Field Summary
Modifier and TypeFieldDescriptionprotected Font
protected final org.apache.batik.bridge.FontFamilyResolver
protected final FontInfo
the font collectionprotected static final org.apache.commons.logging.Log
the logger for this classprotected org.apache.batik.gvt.text.TextPaintInfo
Fields inherited from class org.apache.batik.bridge.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.bridge.BasicTextPainter
aaOffFontRenderContext, fontRenderContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
protected abstract void
protected CharSequence
Collects all characters from anAttributedCharacterIterator
.computeTextRuns
(org.apache.batik.bridge.TextNode node, AttributedCharacterIterator nodeACI, AttributedCharacterIterator[] chunkACIs) protected abstract void
protected org.apache.batik.bridge.FontFamilyResolver
protected org.apache.batik.bridge.TextLayoutFactory
protected Set
protected abstract boolean
isSupported
(Graphics2D g2d) Indicates whether the givenGraphics2D
instance if compatible with this text painter implementation.protected final void
logCharacter
(char ch, org.apache.batik.bridge.TextSpanLayout layout, int index, boolean visibleChar) protected final void
logTextRun
(org.apache.batik.bridge.StrokingTextPainter.TextRun textRun) protected final void
paintTextRun
(org.apache.batik.bridge.StrokingTextPainter.TextRun textRun, Graphics2D g2d) Paints a single text run.protected void
paintTextRuns
(List textRuns, Graphics2D g2d) protected abstract void
positionGlyph
(Point2D prevPos, Point2D glyphPos, boolean reposition) protected abstract void
protected List
reorderTextRuns
(org.apache.batik.bridge.StrokingTextPainter.TextChunk chunk, List runs) protected abstract void
protected abstract void
protected abstract void
setInitialTransform
(AffineTransform transform) protected abstract void
writeGlyph
(char glyph, AffineTransform transform) protected void
writeGlyphs
(FOPGVTGlyphVector gv, GeneralPath debugShapes) Methods inherited from class org.apache.batik.bridge.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.bridge.BasicTextPainter
getGeometryBounds, selectAt, selectTo
-
Field Details
-
log
protected static final org.apache.commons.logging.Log logthe logger for this class -
fontInfo
the font collection -
fontFamilyResolver
protected final org.apache.batik.bridge.FontFamilyResolver fontFamilyResolver -
font
-
tpi
protected org.apache.batik.gvt.text.TextPaintInfo tpi
-
-
Constructor Details
-
NativeTextPainter
Creates a new instance.- Parameters:
fontInfo
- the font collection
-
-
Method Details
-
isSupported
Indicates whether the givenGraphics2D
instance if compatible with this text painter implementation.- Parameters:
g2d
- the instance to check- Returns:
- true if the instance is compatible.
-
paintTextRun
protected final void paintTextRun(org.apache.batik.bridge.StrokingTextPainter.TextRun textRun, Graphics2D g2d) throws IOException Paints a single text run.- Parameters:
textRun
- the text rung2d
- the target Graphics2D instance- Throws:
IOException
- if an I/O error occurs while rendering the text
-
writeGlyphs
- Throws:
IOException
-
paintTextRuns
- Overrides:
paintTextRuns
in classorg.apache.batik.bridge.StrokingTextPainter
-
collectCharacters
Collects all characters from anAttributedCharacterIterator
.- Parameters:
runaci
- the character iterator- Returns:
- the characters
-
computeTextRuns
public List computeTextRuns(org.apache.batik.bridge.TextNode node, AttributedCharacterIterator nodeACI, AttributedCharacterIterator[] chunkACIs) - Overrides:
computeTextRuns
in classorg.apache.batik.bridge.StrokingTextPainter
-
getTextRunBoundaryAttributes
- Overrides:
getTextRunBoundaryAttributes
in classorg.apache.batik.bridge.StrokingTextPainter
-
reorderTextRuns
protected List reorderTextRuns(org.apache.batik.bridge.StrokingTextPainter.TextChunk chunk, List runs) - Overrides:
reorderTextRuns
in classorg.apache.batik.bridge.StrokingTextPainter
-
preparePainting
-
saveGraphicsState
- Throws:
IOException
-
restoreGraphicsState
- Throws:
IOException
-
setInitialTransform
- Throws:
IOException
-
clip
- Throws:
IOException
-
beginTextObject
- Throws:
IOException
-
endTextObject
- Throws:
IOException
-
positionGlyph
-
writeGlyph
- Throws:
IOException
-
logTextRun
protected final void logTextRun(org.apache.batik.bridge.StrokingTextPainter.TextRun textRun) -
logCharacter
protected final void logCharacter(char ch, org.apache.batik.bridge.TextSpanLayout layout, int index, boolean visibleChar) - Parameters:
ch
- a characterlayout
- a text span layoutindex
- an indexvisibleChar
- visible character flag
-
getFontFamilyResolver
protected org.apache.batik.bridge.FontFamilyResolver getFontFamilyResolver()- Overrides:
getFontFamilyResolver
in classorg.apache.batik.bridge.StrokingTextPainter
-
getTextLayoutFactory
protected org.apache.batik.bridge.TextLayoutFactory getTextLayoutFactory()- Overrides:
getTextLayoutFactory
in classorg.apache.batik.bridge.BasicTextPainter
-