|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.pdfview.font.PDFFont
public abstract class PDFFont
a Font definition for PDF files
| Constructor Summary | |
|---|---|
protected |
PDFFont(java.lang.String baseFont,
PDFFontDescriptor descriptor)
Create a PDFFont given the base font name and the font descriptor |
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
Compare two fonts base on the baseFont |
java.lang.String |
getBaseFont()
Get the postscript name of this font |
PDFGlyph |
getCachedGlyph(char src,
java.lang.String name)
Get a glyph for a given character code. |
PDFFontDescriptor |
getDescriptor()
Get the descriptor for this font |
PDFFontEncoding |
getEncoding()
Get the encoding for this font |
static PDFFont |
getFont(PDFObject obj,
java.util.HashMap<java.lang.String,PDFObject> resources)
get the PDFFont corresponding to the font described in a PDFObject. |
protected abstract PDFGlyph |
getGlyph(char src,
java.lang.String name)
Get the glyph for a given character code and name The preferred method of getting the glyph should be by name. |
java.util.List<PDFGlyph> |
getGlyphs(java.lang.String text)
Get the glyphs associated with a given String in this font |
java.lang.String |
getSubtype()
Get the subtype of this font. |
PDFCMap |
getUnicodeMap()
Get the CMap which maps the characters in this font to unicode names |
int |
hashCode()
Hash a font based on its base font |
void |
setBaseFont(java.lang.String baseFont)
Set the postscript name of this font |
void |
setDescriptor(PDFFontDescriptor descriptor)
Set the descriptor font descriptor |
void |
setEncoding(PDFFontEncoding encoding)
Set the encoding for this font |
void |
setSubtype(java.lang.String subtype)
Set the font subtype |
void |
setUnicodeMap(PDFCMap unicodeMap)
Set the CMap which maps the characters in this font to unicode names |
java.lang.String |
toString()
Turn this font into a pretty String |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected PDFFont(java.lang.String baseFont,
PDFFontDescriptor descriptor)
baseFont - the postscript name of this fontdescriptor - the descriptor for the font| Method Detail |
|---|
public static PDFFont getFont(PDFObject obj,
java.util.HashMap<java.lang.String,PDFObject> resources)
throws java.io.IOException
For Type1 and TrueType fonts, the dictionary also contains:
BaseFont = (some name, or XXXXXX+Name as a subset of font Name)
For Type3 font, the dictionary contains:
FontBBox = (rectangle)
FontMatrix = (array, typically [0.001, 0, 0, 0.001, 0, 0])
CharProcs = (dictionary)
Resources = (dictionary)
java.io.IOExceptionpublic java.lang.String getSubtype()
public void setSubtype(java.lang.String subtype)
public java.lang.String getBaseFont()
public void setBaseFont(java.lang.String baseFont)
baseFont - the postscript name of the fontpublic PDFFontEncoding getEncoding()
public void setEncoding(PDFFontEncoding encoding)
public PDFFontDescriptor getDescriptor()
public void setDescriptor(PDFFontDescriptor descriptor)
public PDFCMap getUnicodeMap()
public void setUnicodeMap(PDFCMap unicodeMap)
public java.util.List<PDFGlyph> getGlyphs(java.lang.String text)
text - the text to translate into glyphs
public PDFGlyph getCachedGlyph(char src,
java.lang.String name)
src - the character code of this glyphname - the name of the glyph, or null if the name is unknown
protected abstract PDFGlyph getGlyph(char src,
java.lang.String name)
src - the character code of this glyphname - the name of this glyph or null if unknown
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||