multivalent.std.adaptor.pdf

Class Encoding

public class Encoding extends Object

Character encoding, from Macintosh, Windoze, Standard, PDF to Unicode. Can translate to Unicode or differences to original for widths table, and encapsulates bizarre Windows +0xf000.

Version: $Revision: 1.26 $ $Date: 2003/10/04 22:46:47 $

Method Summary
static EncodinggetInstance(Dict fontdict, PDFReader pdfr)
Handles built-in encodings (defaults to StandardEncoding), tweaks according to differences if any.
static String[]getNameMapping(String encoding)
Returns array such that string at index is name of character of that number.
Stringtranslate(StringBuffer sb, boolean basetoo)
Return Unicode translation of passed StringBuffer.

Method Detail

getInstance

public static Encoding getInstance(Dict fontdict, PDFReader pdfr)
Handles built-in encodings (defaults to StandardEncoding), tweaks according to differences if any.

Parameters: font - actual font constructed from same font dictionary. As of this writing, the core 14 fonts aren't bundled in the JAR, so embedded metadata can differ from actual font. The encoding vector for TrueType TeX fonts has to be determined from examination of the actual font.

getNameMapping

public static String[] getNameMapping(String encoding)
Returns array such that string at index is name of character of that number.

Parameters: encoding - ISOLatin1Encoding or StandardEncoding

translate

public String translate(StringBuffer sb, boolean basetoo)
Return Unicode translation of passed StringBuffer.

Parameters: basetoo Mutate passed StringBuffer according to differences table, if any, to match Adobe standard encoding.