Class NativeTextHandler
java.lang.Object
org.apache.fop.render.ps.NativeTextHandler
- All Implemented Interfaces:
org.apache.xmlgraphics.java2d.ps.PSTextHandler, org.apache.xmlgraphics.java2d.TextHandler
public class NativeTextHandler
extends Object
implements org.apache.xmlgraphics.java2d.ps.PSTextHandler
Specialized TextHandler implementation that the PSGraphics2D class delegates to to paint text
using PostScript text operations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringthe current (internal) font nameprotected intthe current font size in millipointsprotected FontCurrently valid Fontprotected FontInfoFontInfo containing all available fontsprotected FontOverriding FontStateprivate org.apache.xmlgraphics.java2d.ps.PSGraphics2D -
Constructor Summary
ConstructorsConstructorDescriptionNativeTextHandler(org.apache.xmlgraphics.java2d.ps.PSGraphics2D g2d, FontInfo fontInfo) Main constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate FontcreateFont(Font f) voiddrawString(Graphics2D g, String s, float x, float y) Draw a string to the PostScript document.private voidescapeText(String text, StringBuffer target) private voidReturn the font information associated with this objectprivate org.apache.xmlgraphics.ps.PSGeneratorvoidsetOverrideFont(Font override) Sets the overriding font.private voidvoidvoid
-
Field Details
-
rootG2D
private org.apache.xmlgraphics.java2d.ps.PSGraphics2D rootG2D -
fontInfo
FontInfo containing all available fonts -
font
Currently valid Font -
overrideFont
Overriding FontState -
currentFontName
the current (internal) font name -
currentFontSize
protected int currentFontSizethe current font size in millipoints
-
-
Constructor Details
-
NativeTextHandler
Main constructor.- Parameters:
g2d- the PSGraphics2D instance this instances is used byfontInfo- the FontInfo object with all available fonts
-
-
Method Details
-
setupFontInfo
private void setupFontInfo() -
getFontInfo
Return the font information associated with this object- Returns:
- the FontInfo object
-
getPSGenerator
private org.apache.xmlgraphics.ps.PSGenerator getPSGenerator() -
writeSetup
- Specified by:
writeSetupin interfaceorg.apache.xmlgraphics.java2d.ps.PSTextHandler- Throws:
IOException
-
writePageSetup
- Specified by:
writePageSetupin interfaceorg.apache.xmlgraphics.java2d.ps.PSTextHandler- Throws:
IOException
-
drawString
Draw a string to the PostScript document. The text is painted using text operations.- Specified by:
drawStringin interfaceorg.apache.xmlgraphics.java2d.TextHandler- Throws:
IOException
-
escapeText
-
createFont
-
establishCurrentFont
- Throws:
IOException
-
setOverrideFont
Sets the overriding font.- Parameters:
override- Overriding Font to set
-