org.foray.ps.encode
Class GlyphList4a

java.lang.Object
  extended by org.foray.ps.encode.GlyphList4a
All Implemented Interfaces:
Serializable, org.axsl.ps.GlyphList
Direct Known Subclasses:
GlyphListAGL, GlyphListZapfDingbats

public class GlyphList4a
extends Object
implements org.axsl.ps.GlyphList, Serializable

Class handling glyph-to-Unicode mappings. Instances of this class manage a set of four arrays. One set of two arrays is used to convert glyph names to Unicode code points. The other set is used to convert Unicode code points to glyph names. Each set can be thought of as a key-value pair, with the keys being in one array and the values being in the other, and the two joined together by a common index. In each set, the "key" array is sorted, which allows an efficient binary search.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.axsl.ps.GlyphList
org.axsl.ps.GlyphList.Predefined
 
Field Summary
static long serialVersionUID
          Constant needed for serialization.
 
Constructor Summary
GlyphList4a(String name, String[] sortedGlyphNames, char[][] codePointsForGlyphNames, char[] sortedCodePoints, short[] glyphNamesForCodePoints)
          Constructor.
 
Method Summary
static GlyphList4a getGlyphList(org.axsl.ps.GlyphList.Predefined predefined)
          Returns a predefined GlyphList.
static org.axsl.ps.GlyphList getGlyphList(String name)
          Returns the named GlyphList if it already exists, or, if it is a predefined GlyphList, creates it and returns it.
 String getName()
          Returns the name of this glyph list.
 boolean isStatic()
          Indicates whether the data in this glyph list is static, that is, tied entirely to the class itself and not built dynamically.
 String mapCodePointToGlyphName(int codePoint)
           
 char mapGlyphNameToCodePoint(String glyphName)
           
static List<org.axsl.ps.GlyphList> standardSourceGlyphLists()
          Returns the standard glyphs lists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Constant needed for serialization.

See Also:
Constant Field Values
Constructor Detail

GlyphList4a

public GlyphList4a(String name,
                   String[] sortedGlyphNames,
                   char[][] codePointsForGlyphNames,
                   char[] sortedCodePoints,
                   short[] glyphNamesForCodePoints)
Constructor.

Parameters:
name - The name of the glyph list being created.
sortedGlyphNames - The array of sorted glyph names.
codePointsForGlyphNames - The array of Unicode code points for each glyph name.
sortedCodePoints - The sorted array of Unicode code points.
glyphNamesForCodePoints - The array of indexes into the glyph name list that correspond to the sorted code points.
Method Detail

mapCodePointToGlyphName

public String mapCodePointToGlyphName(int codePoint)
Specified by:
mapCodePointToGlyphName in interface org.axsl.ps.GlyphList

mapGlyphNameToCodePoint

public char mapGlyphNameToCodePoint(String glyphName)
Specified by:
mapGlyphNameToCodePoint in interface org.axsl.ps.GlyphList

getGlyphList

public static org.axsl.ps.GlyphList getGlyphList(String name)
Returns the named GlyphList if it already exists, or, if it is a predefined GlyphList, creates it and returns it.

Parameters:
name - The name of the GlyphList to be returned.
Returns:
The named glyph list, if it exists or can be created, or null otherwise.

getGlyphList

public static GlyphList4a getGlyphList(org.axsl.ps.GlyphList.Predefined predefined)
Returns a predefined GlyphList.

Parameters:
predefined - The enumeration of the predefined GlyphList to be returned.
Returns:
The glyph list matching predefined.

getName

public String getName()
Returns the name of this glyph list.

Returns:
The name of this glyph list.

standardSourceGlyphLists

public static List<org.axsl.ps.GlyphList> standardSourceGlyphLists()
Returns the standard glyphs lists.

Returns:
The standard glyph lists.

isStatic

public boolean isStatic()
Indicates whether the data in this glyph list is static, that is, tied entirely to the class itself and not built dynamically. This is used primarily to determine whether the instance should actually be serialized. Static subclasses should override this method.

Returns:
True iff all data in this glyph list is static and does not need to be serialized.


Copyright © 2017. All rights reserved.