jPod PDF library

de.intarsys.pdf.encoding
Class CMapEncoding

java.lang.Object
  extended by de.intarsys.pdf.encoding.Encoding
      extended by de.intarsys.pdf.encoding.CMapEncoding

public class CMapEncoding
extends Encoding

This is a wrapper implementation around the CMap definition in the /Encoding entry for a Type0 font.


Field Summary
 
Fields inherited from class de.intarsys.pdf.encoding.Encoding
CN_MacRomanEncoding, CN_StandardEncoding, CN_WinAnsiEncoding, NAME_a, NAME_A, NAME_aacute, NAME_Aacute, NAME_acircumflex, NAME_Acircumflex, NAME_acute, NAME_adieresis, NAME_Adieresis, NAME_ae, NAME_AE, NAME_agrave, NAME_Agrave, NAME_ampersand, NAME_aring, NAME_Aring, NAME_asciicircum, NAME_asciitilde, NAME_asterisk, NAME_at, NAME_atilde, NAME_Atilde, NAME_b, NAME_B, NAME_backslash, NAME_bar, NAME_braceleft, NAME_braceright, NAME_bracketleft, NAME_bracketright, NAME_breve, NAME_brokenbar, NAME_bullet, NAME_c, NAME_C, NAME_caron, NAME_ccedilla, NAME_Ccedilla, NAME_cedilla, NAME_cent, NAME_circumflex, NAME_colon, NAME_comma, NAME_copyright, NAME_currency, NAME_d, NAME_D, NAME_dagger, NAME_daggerdbl, NAME_degree, NAME_dieresis, NAME_divide, NAME_dollar, NAME_dotaccent, NAME_dotlessi, NAME_e, NAME_E, NAME_eacute, NAME_Eacute, NAME_ecircumflex, NAME_Ecircumflex, NAME_edieresis, NAME_Edieresis, NAME_egrave, NAME_Egrave, NAME_eight, NAME_ellipsis, NAME_emdash, NAME_endash, NAME_equal, NAME_eth, NAME_Eth, NAME_Euro, NAME_exclam, NAME_exclamdown, NAME_f, NAME_F, NAME_fi, NAME_five, NAME_fl, NAME_florin, NAME_four, NAME_fraction, NAME_g, NAME_G, NAME_germandbls, NAME_grave, NAME_greater, NAME_guillemotleft, NAME_guillemotright, NAME_guilsinglleft, NAME_guilsinglright, NAME_h, NAME_H, NAME_hungarumlaut, NAME_hyphen, NAME_i, NAME_I, NAME_iacute, NAME_Iacute, NAME_icircumflex, NAME_Icircumflex, NAME_idieresis, NAME_Idieresis, NAME_igrave, NAME_Igrave, NAME_j, NAME_J, NAME_k, NAME_K, NAME_l, NAME_L, NAME_less, NAME_logicalnot, NAME_lslash, NAME_Lslash, NAME_m, NAME_M, NAME_macron, NAME_minus, NAME_mu, NAME_multiply, NAME_n, NAME_N, NAME_nine, NAME_ntilde, NAME_Ntilde, NAME_numbersign, NAME_o, NAME_O, NAME_oacute, NAME_Oacute, NAME_ocircumflex, NAME_Ocircumflex, NAME_odieresis, NAME_Odieresis, NAME_oe, NAME_OE, NAME_ogonek, NAME_ograve, NAME_Ograve, NAME_one, NAME_onehalf, NAME_onequarter, NAME_onesuperior, NAME_ordfeminine, NAME_ordmasculine, NAME_oslash, NAME_Oslash, NAME_otilde, NAME_Otilde, NAME_p, NAME_P, NAME_paragraph, NAME_parenleft, NAME_parenright, NAME_percent, NAME_period, NAME_periodcentered, NAME_perthousand, NAME_plus, NAME_plusminus, NAME_q, NAME_Q, NAME_question, NAME_questiondown, NAME_quotedbl, NAME_quotedblbase, NAME_quotedblleft, NAME_quotedblright, NAME_quoteleft, NAME_quoteright, NAME_quotesinglbase, NAME_quotesingle, NAME_r, NAME_R, NAME_registered, NAME_ring, NAME_s, NAME_S, NAME_scaron, NAME_Scaron, NAME_section, NAME_semicolon, NAME_seven, NAME_six, NAME_slash, NAME_space, NAME_sterling, NAME_t, NAME_T, NAME_thorn, NAME_Thorn, NAME_three, NAME_threequarters, NAME_threesuperior, NAME_tilde, NAME_trademark, NAME_two, NAME_twosuperior, NAME_u, NAME_U, NAME_uacute, NAME_Uacute, NAME_ucircumflex, NAME_Ucircumflex, NAME_udieresis, NAME_Udieresis, NAME_ugrave, NAME_Ugrave, NAME_underscore, NAME_v, NAME_V, NAME_w, NAME_W, NAME_x, NAME_X, NAME_y, NAME_Y, NAME_yacute, NAME_Yacute, NAME_ydieresis, NAME_Ydieresis, NAME_yen, NAME_z, NAME_Z, NAME_zcaron, NAME_Zcaron, NAME_zero
 
Constructor Summary
CMapEncoding(CMap map)
           
 
Method Summary
 COSObject cosGetObject()
          Get an object that can be used as a representation of the receiver encoding within doc.
 int getDecoded(int codepoint)
          Get the character for the codepoint or -1 if not available.
 int getEncoded(int character)
          Get the codepoint for the the character or -1 if invalid.
 int getEncoded(String name)
          Get the codepoint for the the named character or -1 if invalid.
 String getGlyphName(int codepoint)
          Get the character name for a given encoded codepoint.
 String getName()
          The name of this encoding.
 int getNextDecoded(InputStream is)
          Get the next decoded character from the input stream.
 int getNextEncoded(InputStream is)
          The next codepoint from the input stream.
 void putNextDecoded(OutputStream os, int character)
          Put the next character onto the input stream after encoding.
 void putNextEncoded(OutputStream os, int codepoint)
          Put the next codepoint onto the input stream.
 
Methods inherited from class de.intarsys.pdf.encoding.Encoding
createNamed, createReader, createWriter, decode, decode, decode, encode, encode, encode, encode, getDifferenceDecoded, getDifferenceGlyphName, getValidEncoded, getValidEncoded, isEncodable, isEncodable, isEncodable, isFontSpecificEncoding, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CMapEncoding

public CMapEncoding(CMap map)
Method Detail

cosGetObject

public COSObject cosGetObject()
Description copied from class: Encoding
Get an object that can be used as a representation of the receiver encoding within doc.

Specified by:
cosGetObject in class Encoding
Returns:
Get an object that can be used as a representation of the receiver encoding within doc.

getDecoded

public int getDecoded(int codepoint)
Description copied from class: Encoding
Get the character for the codepoint or -1 if not available.

Specified by:
getDecoded in class Encoding
Parameters:
codepoint - The codepoint
Returns:
Get the character for the codepoint or -1 if not available.

getEncoded

public int getEncoded(int character)
Description copied from class: Encoding
Get the codepoint for the the character or -1 if invalid.

Specified by:
getEncoded in class Encoding
Parameters:
character - The character to look up.
Returns:
Get the codepoint for the the character or -1 if invalid.

getEncoded

public int getEncoded(String name)
Description copied from class: Encoding
Get the codepoint for the the named character or -1 if invalid.

Specified by:
getEncoded in class Encoding
Parameters:
name - The character name to look up.
Returns:
Get the codepoint for the the named character or -1 if invalid.

getGlyphName

public String getGlyphName(int codepoint)
Description copied from class: Encoding
Get the character name for a given encoded codepoint. If no mapping is defined, return ".notdef".

Specified by:
getGlyphName in class Encoding
Parameters:
codepoint - The encoded codepoint.
Returns:
The glyph name of the character referenced by codepoint or ".notdef".

getName

public String getName()
Description copied from class: Encoding
The name of this encoding.

Specified by:
getName in class Encoding
Returns:
The name of this encoding.

getNextDecoded

public int getNextDecoded(InputStream is)
                   throws IOException
Description copied from class: Encoding
Get the next decoded character from the input stream. This method reads as much bytes as needed by the encoding if it is a multibyte encoding and returns the decoded character.

Overrides:
getNextDecoded in class Encoding
Parameters:
is - The input stream with encoded data.
Returns:
The next character from the input stream.
Throws:
IOException

getNextEncoded

public int getNextEncoded(InputStream is)
                   throws IOException
Description copied from class: Encoding
The next codepoint from the input stream. This method reads as much bytes as needed by the encoding if it is a multibyte encoding and returns the complete multibyte codepoint.

Overrides:
getNextEncoded in class Encoding
Parameters:
is - The input stream with encoded data.
Returns:
The next codepoint from the input stream.
Throws:
IOException

putNextDecoded

public void putNextDecoded(OutputStream os,
                           int character)
                    throws IOException
Description copied from class: Encoding
Put the next character onto the input stream after encoding. This method writes as much bytes as needed by the encoding if it is a multibyte encoding.

Overrides:
putNextDecoded in class Encoding
Parameters:
os - The stream to write the bytes.
character - The character to be encoded.
Throws:
IOException

putNextEncoded

public void putNextEncoded(OutputStream os,
                           int codepoint)
                    throws IOException
Description copied from class: Encoding
Put the next codepoint onto the input stream. This method writes as much bytes as needed by the encoding if it is a multibyte encoding.

Overrides:
putNextEncoded in class 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.