Class GFXMapping


  • public class GFXMapping
    extends java.lang.Object
    This class represents one character/glyph mapping.

    Logically, a mapping is represented by a set of (possibly disjoint) character indexes and a set of (possibly disjoint) glyph indexes. In other words, a mapping can be thought of as containing a pair of arrays. The implementation may choose a more efficient representation for common cases.

    • Constructor Summary

      Constructors 
      Constructor Description
      GFXMapping()
      Default constructor.
      GFXMapping​(int nCharIndex, int nGlyphIndex)  
      GFXMapping​(int nCharIndex, int nGlyphIndex, int nCharLength)  
      GFXMapping​(int nCharIndex, int nGlyphIndex, int nCharLength, int nGlyphLength)
      Constructor that initializes the mapping to represent a contiguous run of characters and a contiguous run of glyphs.
      GFXMapping​(GFXMapping oSource)
      Copy constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCharIndex​(int nCharIndex)
      Add another character index to the set of characters represented by this mapping.
      void addGlyphIndex​(int nGlyphIndex)
      Add another glyph index to the set of glyphs represented by this mapping.
      void copyFrom​(GFXMapping oSource)
      Assignment operator.
      int getCharCount()
      Return the number of character indexes currently in the mapping.
      int getCharIndex​(int nIndex)
      Extract one character index from the mapping.
      int getGlyphCount()
      Return the number of glyph indexes currently in the mapping.
      int getGlyphIndex​(int nIndex)
      Extract one glyph index from the mapping.
      int getHighestCharIndex()
      Return the highest character index from the mapping.
      int getHighestGlyphIndex()
      Return the highest glyph index from the mapping.
      int getLowestCharIndex()
      Return the lowest character index from the mapping.
      int getLowestGlyphIndex()
      Return the lowest glyph index from the mapping.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GFXMapping

        public GFXMapping()
        Default constructor.

        The mapping is initialized to an invalid state. The set of characters and the set of glyphs are both empty. Adding such a mapping to a mapping list is an error.

      • GFXMapping

        public GFXMapping​(GFXMapping oSource)
        Copy constructor. The mapping is created with the same content as the given mapping.
        Parameters:
        oSource - - Source mapping object to copy.
      • GFXMapping

        public GFXMapping​(int nCharIndex,
                          int nGlyphIndex,
                          int nCharLength,
                          int nGlyphLength)
        Constructor that initializes the mapping to represent a contiguous run of characters and a contiguous run of glyphs.

        The client specifies the mapping in terms of four parameters identifying both a sequential run of characters and a sequential run of glyphs. Given the parameter names listed in the method declaration, the mapping is interpreted as the nCharLength characters in the Unicode text, starting at index nCharIndex, map to the nGlyphLength glyphs in the rendering starting at nGlyphIndex.

        Parameters:
        nCharIndex - - Starting character index of the mapping.
        nGlyphIndex - - Starting glyph index of the mapping.
        nCharLength - - Number of consecutive Unicode characters in the mapping.
        nGlyphLength - - Number of consecutive glyphs in the mapping.
      • GFXMapping

        public GFXMapping​(int nCharIndex,
                          int nGlyphIndex,
                          int nCharLength)
      • GFXMapping

        public GFXMapping​(int nCharIndex,
                          int nGlyphIndex)
    • Method Detail

      • addCharIndex

        public void addCharIndex​(int nCharIndex)
        Add another character index to the set of characters represented by this mapping.

        This method is typically called only if the mapping represents a set of non-contiguous characters in the Unicode text.

        Parameters:
        nCharIndex - - Character index to add to the mapping.
      • getCharCount

        public int getCharCount()
        Return the number of character indexes currently in the mapping.
        Returns:
        Number of character indexes currently in the mapping.
      • getCharIndex

        public int getCharIndex​(int nIndex)
        Extract one character index from the mapping.

        The character indexes themselves are indexed from zero up to one less than the value returned by GetCharCount().

        Parameters:
        nIndex - - Index of the desired character index.
        Returns:
        Character index value.
      • getLowestCharIndex

        public int getLowestCharIndex()
        Return the lowest character index from the mapping.

        The lowest character index may not be the first in the list of character index, depending on the order added. It is an error to call this method if the mapping contains no character index values.

        Returns:
        Lowest character index value.
      • getHighestCharIndex

        public int getHighestCharIndex()
        Return the highest character index from the mapping.

        The highest character index may not be the last in the list of character index, depending on the order added. It is an error to call this method if the mapping contains no character index values.

        Returns:
        Highest character index value.
      • addGlyphIndex

        public void addGlyphIndex​(int nGlyphIndex)
        Add another glyph index to the set of glyphs represented by this mapping.

        This method is typically called only if the mapping represents a set of non-contiguous glyphs in the Unicode text.

        Parameters:
        nGlyphIndex - - Glyphacter index to add to the mapping.
      • getGlyphCount

        public int getGlyphCount()
        Return the number of glyph indexes currently in the mapping.
        Returns:
        Number of glyph indexes currently in the mapping.
      • getGlyphIndex

        public int getGlyphIndex​(int nIndex)
        Extract one glyph index from the mapping.

        The glyph indexes themselves are indexed from zero up to one less than the value returned by GetGlyphCount().

        Parameters:
        nIndex - - Index of the desired glyph index.
        Returns:
        Glyphacter index value.
      • getLowestGlyphIndex

        public int getLowestGlyphIndex()
        Return the lowest glyph index from the mapping.

        The lowest glyph index may not be the first in the list of glyph index, depending on the order added. It is an error to call this method if the mapping contains no glyph index values.

        Returns:
        Lowest glyph index value.
      • getHighestGlyphIndex

        public int getHighestGlyphIndex()
        Return the highest glyph index from the mapping.

        The highest glyph index may not be the last in the list of glyph index, depending on the order added. It is an error to call this method if the mapping contains no glyph index values.

        Returns:
        Highest glyph index value.
      • copyFrom

        public void copyFrom​(GFXMapping oSource)
        Assignment operator.

        This mapping's content is replaced with a copy of the content from the given mapping.

        Parameters:
        oSource - - Source mapping object to copy.