Class TextArea

    • Field Detail

      • isHyphenated

        private boolean isHyphenated
    • Constructor Detail

      • TextArea

        public TextArea()
        Create a text inline area
      • TextArea

        public TextArea​(int stretch,
                        int shrink,
                        int adj)
        Constructor with extra parameters: create a TextAdjustingInfo object
        Parameters:
        stretch - the available stretch of the text
        shrink - the available shrink of the text
        adj - the current total adjustment
    • Method Detail

      • removeText

        public void removeText()
        Remove the old text
      • addWord

        public void addWord​(java.lang.String word,
                            int offset)
        Create and add a WordArea child to this TextArea.
        Parameters:
        word - the word string
        offset - the offset for the next area
      • addWord

        public void addWord​(java.lang.String word,
                            int offset,
                            int level)
        Create and add a WordArea child to this TextArea.
        Parameters:
        word - the word string
        offset - the offset for the next area
        level - bidirectional level that applies to entire word
      • addWord

        public void addWord​(java.lang.String word,
                            int ipd,
                            int[] letterAdjust,
                            int[] levels,
                            int[][] gposAdjustments,
                            int blockProgressionOffset,
                            boolean nextIsSpace)
        Create and add a WordArea child to this TextArea.
        Parameters:
        word - the word string
        ipd - the word's ipd
        letterAdjust - the letter adjustment array (may be null)
        levels - array of resolved bidirectional levels of word characters, or null if default level
        gposAdjustments - array of general position adjustments or null if none apply
        blockProgressionOffset - the offset for the next area
      • addWord

        public void addWord​(java.lang.String word,
                            int ipd,
                            int[] letterAdjust,
                            int[] levels,
                            int[][] gposAdjustments,
                            int blockProgressionOffset)
      • addSpace

        public void addSpace​(char space,
                             int ipd,
                             boolean adjustable,
                             int blockProgressionOffset,
                             int level)
        Create and add a SpaceArea child to this TextArea
        Parameters:
        space - the space character
        ipd - the space's ipd
        blockProgressionOffset - the offset for the next area
        adjustable - is this space adjustable?
        level - resolved bidirection level of space character
      • setHyphenated

        public void setHyphenated()
        Records that the last word in this text area is hyphenated.
      • isHyphenated

        public boolean isHyphenated()
        Returns true if the last word in this area is hyphenated.
      • getText

        public java.lang.String getText()
        Get the whole text string. Renderers whose space adjustment handling is not affected by multi-byte characters can use this method to render the whole TextArea at once; the other renderers (for example PDFRenderer) have to implement renderWord(WordArea) and renderSpace(SpaceArea) in order to correctly place each text fragment.
        Returns:
        the text string
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Area
        Returns:
        ipd and bpd of area
      • updateLevel

        public void updateLevel​(int newLevel)
      • findMinLevel

        private static int findMinLevel​(int[] levels,
                                        int defaultLevel)
      • makeLevels

        private int[] makeLevels​(int level,
                                 int count)