org.foray.ps.encode
Class CMap04

java.lang.Object
  extended by org.foray.ps.encode.CMap
      extended by org.foray.ps.encode.CMap04
All Implemented Interfaces:
org.axsl.ps.Cmap, org.axsl.ps.Cmap04, org.axsl.ps.Encoding

public class CMap04
extends CMap
implements org.axsl.ps.Cmap04

Class containing a set of 16-bit Unicode ranges that sequentially map to the same-sized range of glyph indexes. The contents are analogous to a Format 4 TrueType Font cmap table (from which this class derives its name).


Field Summary
static long serialVersionUID
          Constant needed for serialization.
 
Fields inherited from interface org.axsl.ps.Encoding
INVALID_UNICODE_CHAR
 
Constructor Summary
CMap04(String name, int expectedEntries)
          Constructor.
 
Method Summary
 void addEntry(char unicodeStart, char unicodeEnd, char glyphStartIndex)
           
 void addEntry(char unicodeStart, char unicodeEnd, char[] glyphIndexes)
          Add a new entry to this map, converting the input values to an entry.
 void addEntry(CMap04Entry entry)
          Add a new entry to this map.
 String asPostScript(org.axsl.ps.Encoding baseEncoding)
           
 int decodeCharacter(int glyphIndexInput)
           
 int encodeCharacter(int c)
           
 int getFirstIndex()
           
 int getLastIndex()
           
 String getName()
           
 
Methods inherited from class org.foray.ps.encode.CMap
canEncode, isPredefinedPdf, isPredefinedPs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.axsl.ps.Encoding
canEncode, isPredefinedPdf, isPredefinedPs
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Constant needed for serialization.

See Also:
Constant Field Values
Constructor Detail

CMap04

public CMap04(String name,
              int expectedEntries)
Constructor.

Parameters:
name - The name of this encoding.
expectedEntries - The number of expected entries in this encoding. Setting this to the correct value will result in more efficient processing.
Method Detail

getName

public String getName()
Specified by:
getName in interface org.axsl.ps.Encoding

addEntry

public void addEntry(CMap04Entry entry)
Add a new entry to this map.

Parameters:
entry - The entry to be added.

addEntry

public void addEntry(char unicodeStart,
                     char unicodeEnd,
                     char glyphStartIndex)
Specified by:
addEntry in interface org.axsl.ps.Cmap04

addEntry

public void addEntry(char unicodeStart,
                     char unicodeEnd,
                     char[] glyphIndexes)
Add a new entry to this map, converting the input values to an entry.

Specified by:
addEntry in interface org.axsl.ps.Cmap04
Parameters:
unicodeStart - The starting Unicode code point for this map.
unicodeEnd - The ending Unicode code point for this map.
glyphIndexes - The array of glyph indexes corresponding to the range unicodeStart through unicodeEnd.

encodeCharacter

public int encodeCharacter(int c)
Specified by:
encodeCharacter in interface org.axsl.ps.Encoding

decodeCharacter

public int decodeCharacter(int glyphIndexInput)
Specified by:
decodeCharacter in interface org.axsl.ps.Encoding

asPostScript

public String asPostScript(org.axsl.ps.Encoding baseEncoding)
Specified by:
asPostScript in interface org.axsl.ps.Encoding

getFirstIndex

public int getFirstIndex()
Specified by:
getFirstIndex in interface org.axsl.ps.Encoding

getLastIndex

public int getLastIndex()
Specified by:
getLastIndex in interface org.axsl.ps.Encoding


Copyright © 2017. All rights reserved.