jPod PDF library

de.intarsys.pdf.font
Class CMap

java.lang.Object
  extended by de.intarsys.pdf.cos.COSBasedObject
      extended by de.intarsys.pdf.font.CMap
All Implemented Interfaces:
ICOSObjectListener, de.intarsys.tools.attribute.IAttributeSupport
Direct Known Subclasses:
IdentityCMap, StreamBasedCMap

public abstract class CMap
extends COSBasedObject

A character map. This object can map from codepoints to CID's which can be used to select glyphs in a CID keyed font object.


Nested Class Summary
static class CMap.MetaClass
          The meta class implementation
 
Field Summary
static CMap.MetaClass META
          The meta class instance
 
Method Summary
abstract  char[] getChars(int codepoint)
          Get the char[] for the codepoint or null if not available.
abstract  int getDecoded(int codepoint)
          Get the character for the codepoint or -1 if not available.
abstract  int getEncoded(int character)
          Get the codepoint for the the character or -1 if invalid.
abstract  int getNextDecoded(InputStream is)
          Get the next decoded character from the input stream.
abstract  int getNextEncoded(InputStream is)
          The next codepoint from the input stream.
abstract  void putNextDecoded(OutputStream os, int character)
          Put the next character onto the input stream after encoding.
abstract  void putNextEncoded(OutputStream os, int codepoint)
          Put the next codepoint onto the input stream.
static int toInt(byte[] bytes)
           
static int toInt(byte[] bytes, int offset, int length)
           
 
Methods inherited from class de.intarsys.pdf.cos.COSBasedObject
changed, cosGetArray, cosGetDict, cosGetDoc, cosGetField, cosGetObject, cosGetStream, cosHasField, cosRemoveField, cosSetField, getAttribute, getFieldBoolean, getFieldDate, getFieldFixed, getFieldFixedArray, getFieldInt, getFieldMLString, getFieldString, invalidateCaches, removeAttribute, setAttribute, setFieldBoolean, setFieldFixed, setFieldInt, setFieldMLString, setFieldName, setFieldObject, setFieldString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

META

public static final CMap.MetaClass META
The meta class instance

Method Detail

toInt

public static int toInt(byte[] bytes)

toInt

public static int toInt(byte[] bytes,
                        int offset,
                        int length)

getChars

public abstract char[] getChars(int codepoint)
Get the char[] for the codepoint or null if not available. This is used in /ToUnicode mappings where a codepoint may map to a string (as for example in ligatures).

Parameters:
codepoint - The codepoint
Returns:
The corresponding char[] for the codepoint.

getDecoded

public abstract int getDecoded(int codepoint)
Get the character for the codepoint or -1 if not available.

Parameters:
codepoint - The codepoint
Returns:
Get the character for the codepoint or -1 if not available.

getEncoded

public abstract int getEncoded(int character)
Get the codepoint for the the character or -1 if invalid.

Parameters:
character - The character to look up.
Returns:
Get the codepoint for the the character or -1 if invalid.

getNextDecoded

public abstract int getNextDecoded(InputStream is)
                            throws IOException
Get the next decoded character from the input stream. This method reads as much bytes as needed by the encoding and returns the decoded character.

Parameters:
is - The input stream with encoded data.
Returns:
The next decoded character from the input stream.
Throws:
IOException

getNextEncoded

public abstract int getNextEncoded(InputStream is)
                            throws IOException
The next codepoint from the input stream. This method reads as much bytes as needed by the encoding and returns the complete multibyte codepoint.

Parameters:
is - The input stream with encoded data.
Returns:
The next codepoint from the input stream.
Throws:
IOException

putNextDecoded

public abstract void putNextDecoded(OutputStream os,
                                    int character)
                             throws IOException
Put the next character onto the input stream after encoding. This method writes as much bytes as needed by the encoding.

Parameters:
os - The stream to write the bytes.
character - The character to be encoded.
Throws:
IOException

putNextEncoded

public abstract void putNextEncoded(OutputStream os,
                                    int codepoint)
                             throws IOException
Put the next codepoint onto the input stream. This method writes as much bytes as needed by the encoding.

Parameters:
os - The stream to write the bytes.
codepoint - The codepoint.
Throws:
IOException

jPod PDF library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.