public abstract class NativeTextPainter
extends org.apache.batik.bridge.StrokingTextPainter
| Modifier and Type | Field and Description |
|---|---|
protected Font |
font |
protected org.apache.batik.bridge.FontFamilyResolver |
fontFamilyResolver |
protected FontInfo |
fontInfo
the font collection
|
protected static org.apache.commons.logging.Log |
log
the logger for this class
|
protected org.apache.batik.gvt.text.TextPaintInfo |
tpi |
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| Constructor and Description |
|---|
NativeTextPainter(FontInfo fontInfo)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
beginTextObject() |
protected abstract void |
clip(Shape clip) |
protected CharSequence |
collectCharacters(AttributedCharacterIterator runaci)
Collects all characters from an
AttributedCharacterIterator. |
List |
computeTextRuns(org.apache.batik.bridge.TextNode node,
AttributedCharacterIterator nodeACI,
AttributedCharacterIterator[] chunkACIs) |
protected abstract void |
endTextObject() |
protected org.apache.batik.bridge.FontFamilyResolver |
getFontFamilyResolver() |
protected org.apache.batik.bridge.TextLayoutFactory |
getTextLayoutFactory() |
protected Set |
getTextRunBoundaryAttributes() |
protected abstract boolean |
isSupported(Graphics2D g2d)
Indicates whether the given
Graphics2D instance if compatible with this text painter
implementation. |
protected void |
logCharacter(char ch,
org.apache.batik.bridge.TextSpanLayout layout,
int index,
boolean visibleChar) |
protected void |
logTextRun(org.apache.batik.bridge.StrokingTextPainter.TextRun textRun) |
protected 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 |
preparePainting(Graphics2D g2d) |
protected List |
reorderTextRuns(org.apache.batik.bridge.StrokingTextPainter.TextChunk chunk,
List runs) |
protected abstract void |
restoreGraphicsState() |
protected abstract void |
saveGraphicsState() |
protected abstract void |
setInitialTransform(AffineTransform transform) |
protected abstract void |
writeGlyph(char glyph,
AffineTransform transform) |
protected void |
writeGlyphs(FOPGVTGlyphVector gv,
GeneralPath debugShapes) |
adjustChunkOffsets, computeTextRuns, createModifiedACIForFontMatching, getBounds2D, getDecorationOutline, getDecorationStrokeOutline, getHighlightShape, getInstance, getMark, getOutline, getSelected, getTextChunk, getTextChunkACIs, getTextRuns, hitTest, paint, paintDecorations, printAttrs, selectFirst, selectLastprotected static final org.apache.commons.logging.Log log
protected final FontInfo fontInfo
protected final org.apache.batik.bridge.FontFamilyResolver fontFamilyResolver
protected Font font
protected org.apache.batik.gvt.text.TextPaintInfo tpi
public NativeTextPainter(FontInfo fontInfo)
fontInfo - the font collectionprotected abstract boolean isSupported(Graphics2D g2d)
Graphics2D instance if compatible with this text painter
implementation.g2d - the instance to checkprotected final void paintTextRun(org.apache.batik.bridge.StrokingTextPainter.TextRun textRun,
Graphics2D g2d)
throws IOException
textRun - the text rung2d - the target Graphics2D instanceIOException - if an I/O error occurs while rendering the textprotected void writeGlyphs(FOPGVTGlyphVector gv, GeneralPath debugShapes) throws IOException
IOExceptionprotected void paintTextRuns(List textRuns, Graphics2D g2d)
paintTextRuns in class org.apache.batik.bridge.StrokingTextPainterprotected CharSequence collectCharacters(AttributedCharacterIterator runaci)
AttributedCharacterIterator.runaci - the character iteratorpublic List computeTextRuns(org.apache.batik.bridge.TextNode node, AttributedCharacterIterator nodeACI, AttributedCharacterIterator[] chunkACIs)
computeTextRuns in class org.apache.batik.bridge.StrokingTextPainterprotected Set getTextRunBoundaryAttributes()
getTextRunBoundaryAttributes in class org.apache.batik.bridge.StrokingTextPainterprotected List reorderTextRuns(org.apache.batik.bridge.StrokingTextPainter.TextChunk chunk, List runs)
reorderTextRuns in class org.apache.batik.bridge.StrokingTextPainterprotected abstract void preparePainting(Graphics2D g2d)
protected abstract void saveGraphicsState()
throws IOException
IOExceptionprotected abstract void restoreGraphicsState()
throws IOException
IOExceptionprotected abstract void setInitialTransform(AffineTransform transform) throws IOException
IOExceptionprotected abstract void clip(Shape clip) throws IOException
IOExceptionprotected abstract void beginTextObject()
throws IOException
IOExceptionprotected abstract void endTextObject()
throws IOException
IOExceptionprotected abstract void positionGlyph(Point2D prevPos, Point2D glyphPos, boolean reposition)
protected abstract void writeGlyph(char glyph,
AffineTransform transform)
throws IOException
IOExceptionprotected final void logTextRun(org.apache.batik.bridge.StrokingTextPainter.TextRun textRun)
protected final void logCharacter(char ch,
org.apache.batik.bridge.TextSpanLayout layout,
int index,
boolean visibleChar)
ch - a characterlayout - a text span layoutindex - an indexvisibleChar - visible character flagprotected org.apache.batik.bridge.FontFamilyResolver getFontFamilyResolver()
getFontFamilyResolver in class org.apache.batik.bridge.StrokingTextPainterprotected org.apache.batik.bridge.TextLayoutFactory getTextLayoutFactory()
getTextLayoutFactory in class org.apache.batik.bridge.BasicTextPainterCopyright © 2023 Apache Software Foundation. All rights reserved.