Class IFRenderer.TextUtil

  • Enclosing class:
    IFRenderer

    private class IFRenderer.TextUtil
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int[][] dp  
      private static int INITIAL_BUFFER_SIZE  
      private boolean nextIsSpace  
      private int startx  
      private int starty  
      private java.lang.StringBuffer text  
      private int tls  
      private int tws  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private TextUtil()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void addChar​(char ch)  
      (package private) void adjust​(int dx)  
      (package private) void adjust​(int[] pa)  
      (package private) void drawText​(int x, int y, int letterSpacing, int wordSpacing, int[][] dx, java.lang.String text, boolean nextIsSpace)  
      (package private) void flush()  
      (package private) void reset()  
      (package private) void setSpacing​(int tls, int tws)  
      (package private) void setStartPosition​(int x, int y)  
      private int[][] trimAdjustments​(int[][] dp, int textLength)
      Trim adjustments array dp to be no greater length than text length, and where trailing all-zero entries are removed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • dp

        private int[][] dp
      • text

        private final java.lang.StringBuffer text
      • startx

        private int startx
      • starty

        private int starty
      • tls

        private int tls
      • tws

        private int tws
      • nextIsSpace

        private boolean nextIsSpace
    • Constructor Detail

      • TextUtil

        private TextUtil()
    • Method Detail

      • addChar

        void addChar​(char ch)
      • adjust

        void adjust​(int dx)
      • adjust

        void adjust​(int[] pa)
      • reset

        void reset()
      • setStartPosition

        void setStartPosition​(int x,
                              int y)
      • setSpacing

        void setSpacing​(int tls,
                        int tws)
      • flush

        void flush()
      • drawText

        void drawText​(int x,
                      int y,
                      int letterSpacing,
                      int wordSpacing,
                      int[][] dx,
                      java.lang.String text,
                      boolean nextIsSpace)
               throws IFException
        Throws:
        IFException
      • trimAdjustments

        private int[][] trimAdjustments​(int[][] dp,
                                        int textLength)
        Trim adjustments array dp to be no greater length than text length, and where trailing all-zero entries are removed.
        Parameters:
        dp - a position adjustments array (or null)
        textLength - the length of the associated text
        Returns:
        either the original value of dp or a copy of its first N significant adjustment entries, such that N is no greater than text length, and the last entry has a non-zero adjustment.