Package org.apache.fop.afp.svg
Class AFPTextHandler
- java.lang.Object
-
- org.apache.xmlgraphics.java2d.StrokingTextHandler
-
- org.apache.fop.svg.FOPTextHandlerAdapter
-
- org.apache.fop.afp.svg.AFPTextHandler
-
- All Implemented Interfaces:
FOPTextHandler
,org.apache.xmlgraphics.java2d.TextHandler
public class AFPTextHandler extends FOPTextHandlerAdapter
Specialized TextHandler implementation that the AFPGraphics2D class delegates to to paint text using AFP GOCA text operations.
-
-
Field Summary
Fields Modifier and Type Field Description private FontInfo
fontInfo
Font informationprivate static org.apache.commons.logging.Log
log
logging instanceprotected Font
overrideFont
Overriding FontStateprivate AFPResourceManager
resourceManager
the resource manager
-
Constructor Summary
Constructors Constructor Description AFPTextHandler(FontInfo fontInfo, AFPResourceManager resourceManager)
Main constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
drawString(java.awt.Graphics2D g, java.lang.String str, float x, float y)
Add a text string to the current data object of the AFP datastream.FontInfo
getFontInfo()
Return the font information associated with this objectprivate int
registerPageFont(AFPPageFonts pageFonts, java.lang.String internalFontName, int fontSize)
Registers a page fontvoid
setOverrideFont(Font overrideFont)
Sets the overriding font.
-
-
-
Field Detail
-
log
private static org.apache.commons.logging.Log log
logging instance
-
overrideFont
protected Font overrideFont
Overriding FontState
-
fontInfo
private final FontInfo fontInfo
Font information
-
resourceManager
private AFPResourceManager resourceManager
the resource manager
-
-
Constructor Detail
-
AFPTextHandler
public AFPTextHandler(FontInfo fontInfo, AFPResourceManager resourceManager)
Main constructor.- Parameters:
fontInfo
- the AFPGraphics2D instanceresourceManager
- the AFPResourceManager instance
-
-
Method Detail
-
getFontInfo
public FontInfo getFontInfo()
Return the font information associated with this object- Returns:
- the FontInfo object
-
registerPageFont
private int registerPageFont(AFPPageFonts pageFonts, java.lang.String internalFontName, int fontSize)
Registers a page font- Parameters:
internalFontName
- the internal font namefontSize
- the font size- Returns:
- a font reference
-
drawString
public void drawString(java.awt.Graphics2D g, java.lang.String str, float x, float y)
Add a text string to the current data object of the AFP datastream. The text is painted using text operations.- Specified by:
drawString
in interfaceorg.apache.xmlgraphics.java2d.TextHandler
- Overrides:
drawString
in classorg.apache.xmlgraphics.java2d.StrokingTextHandler
-
setOverrideFont
public void setOverrideFont(Font overrideFont)
Sets the overriding font.- Parameters:
overrideFont
- Overriding Font to set
-
-