|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.lowagie.text.pdf.BaseFont
com.lowagie.text.pdf.DocumentFont
com.lowagie.text.pdf.CMapAwareDocumentFont
public class CMapAwareDocumentFont
Implementation of DocumentFont used while parsing PDF streams.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.lowagie.text.pdf.BaseFont |
|---|
BaseFont.StreamFont |
| Field Summary | |
|---|---|
private char[] |
cidbyte2uni
Mapping between CID code (single byte only for now) and unicode equivalent as derived by the font's encoding. |
private PdfDictionary |
fontDic
The font dictionary. |
private int |
spaceWidth
the width of a space for this font, in normalized 1000 point units |
private CMap |
toUnicodeCmap
The CMap constructed from the ToUnicode map from the font's dictionary, if present. |
| Constructor Summary | |
|---|---|
CMapAwareDocumentFont(PRIndirectReference refFont)
Creates an instance of a CMapAwareFont based on an indirect reference to a font. |
|
| Method Summary | |
|---|---|
private int |
computeAverageWidth()
For all widths of all glyphs, compute the average width in normalized 1000 point units. |
String |
decode(byte[] cidbytes,
int offset,
int len)
Decodes a string of bytes (encoded in the font's encoding) into a unicode string This will use the ToUnicode map of the font, if available, otherwise it uses the font's encoding |
private String |
decodeSingleCID(byte[] bytes,
int offset,
int len)
Decodes a single CID (represented by one or two bytes) to a unicode String. |
String |
encode(byte[] bytes,
int offset,
int len)
Deprecated. method name is not indicative of what it does. Use decode instead. |
int |
getWidth(int char1)
Gets the width of a char in normalized 1000 units. |
private void |
processToUnicode()
Parses the ToUnicode entry, if present, and constructs a CMap for it |
private void |
processUni2Byte()
Inverts DocumentFont's uni2byte mapping to obtain a cid-to-unicode mapping based on the font's encoding |
| Methods inherited from class com.lowagie.text.pdf.DocumentFont |
|---|
charExists, convertToBytes, convertToBytes, getAllNameEntries, getCharBBox, getFamilyFontName, getFontDescriptor, getFullFontName, getFullFontStream, getIndirectReference, getKerning, getPostscriptFontName, getRawCharBBox, getRawWidth, getUni2Byte, getWidth, hasKernPairs, setKerning, setPostscriptFontName, writeFont |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private PdfDictionary fontDic
private int spaceWidth
private CMap toUnicodeCmap
private char[] cidbyte2uni
| Constructor Detail |
|---|
public CMapAwareDocumentFont(PRIndirectReference refFont)
refFont - the indirect reference to a font| Method Detail |
|---|
private void processToUnicode()
private void processUni2Byte()
private int computeAverageWidth()
public int getWidth(int char1)
DocumentFontchar in normalized 1000 units.
getWidth in class DocumentFontchar1 - the unicode char to get the width of
DocumentFont.getWidth(int)
private String decodeSingleCID(byte[] bytes,
int offset,
int len)
bytes - the bytes making up the character code to convertoffset - an offsetlen - a length
public String decode(byte[] cidbytes,
int offset,
int len)
cidbytes - the bytes that need to be decoded
public String encode(byte[] bytes,
int offset,
int len)
decode instead.
bytes - the bytes from a streamoffset - an offsetlen - a length
|
Hosted by Hostbasket | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||