Class PSTextPainter

  • All Implemented Interfaces:
    org.apache.batik.bridge.TextPainter

    public class PSTextPainter
    extends NativeTextPainter
    Renders the attributed character iterator of a TextNode. This class draws the text directly using PostScript text operators so the text is not drawn using shapes which makes the PS files larger.

    The text runs are split into smaller text runs that can be bundles in single calls of the xshow, yshow or xyshow operators. For outline text, the charpath operator is used.

    • 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

      • 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

      Constructors 
      Constructor Description
      PSTextPainter​(FontInfo fontInfo)
      Create a new PS text painter with the given font information.
    • Constructor Detail

      • PSTextPainter

        public PSTextPainter​(FontInfo fontInfo)
        Create a new PS text painter with the given font information.
        Parameters:
        fontInfo - the font collection
    • Method Detail

      • isSupported

        protected boolean isSupported​(java.awt.Graphics2D g2d)
        Indicates whether the given Graphics2D instance if compatible with this text painter implementation.
        Specified by:
        isSupported in class NativeTextPainter
        Parameters:
        g2d - the instance to check
        Returns:
        true if the instance is compatible.
      • saveGraphicsState

        protected void saveGraphicsState()
                                  throws java.io.IOException
        Specified by:
        saveGraphicsState in class NativeTextPainter
        Throws:
        java.io.IOException
      • setInitialTransform

        protected void setInitialTransform​(java.awt.geom.AffineTransform transform)
                                    throws java.io.IOException
        Specified by:
        setInitialTransform in class NativeTextPainter
        Throws:
        java.io.IOException
      • clip

        protected void clip​(java.awt.Shape shape)
                     throws java.io.IOException
        Specified by:
        clip in class NativeTextPainter
        Throws:
        java.io.IOException
      • beginTextObject

        protected void beginTextObject()
                                throws java.io.IOException
        Specified by:
        beginTextObject in class NativeTextPainter
        Throws:
        java.io.IOException
      • endTextObject

        protected void endTextObject()
                              throws java.io.IOException
        Specified by:
        endTextObject in class NativeTextPainter
        Throws:
        java.io.IOException
      • positionGlyph

        protected void positionGlyph​(java.awt.geom.Point2D prevPos,
                                     java.awt.geom.Point2D glyphPos,
                                     boolean reposition)
        Specified by:
        positionGlyph in class NativeTextPainter
      • writeGlyph

        protected void writeGlyph​(char glyph,
                                  java.awt.geom.AffineTransform localTransform)
                           throws java.io.IOException
        Specified by:
        writeGlyph in class NativeTextPainter
        Throws:
        java.io.IOException