Package org.apache.fop.render.ps
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 String
the current (internal) font nameprotected int
the current font size in millipointsprotected Font
Currently valid Fontprotected FontInfo
FontInfo containing all available fontsprotected Font
Overriding 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 Font
createFont
(Font f) void
drawString
(Graphics2D g, String s, float x, float y) Draw a string to the PostScript document.private void
escapeText
(String text, StringBuffer target) private void
Return the font information associated with this objectprivate org.apache.xmlgraphics.ps.PSGenerator
void
setOverrideFont
(Font override) Sets the overriding font.private void
void
void
-
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:
writeSetup
in interfaceorg.apache.xmlgraphics.java2d.ps.PSTextHandler
- Throws:
IOException
-
writePageSetup
- Specified by:
writePageSetup
in 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:
drawString
in interfaceorg.apache.xmlgraphics.java2d.TextHandler
- Throws:
IOException
-
escapeText
-
createFont
-
establishCurrentFont
- Throws:
IOException
-
setOverrideFont
Sets the overriding font.- Parameters:
override
- Overriding Font to set
-