|
jPod PDF library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.intarsys.pdf.cos.COSBasedObject
de.intarsys.pdf.pd.PDObject
de.intarsys.pdf.font.PDFont
public abstract class PDFont
A PDF font object.
Nested Class Summary | |
---|---|
static class |
PDFont.MetaClass
The meta class implementation |
Field Summary | |
---|---|
static COSName |
CN_Subtype_CIDFontType0
|
static COSName |
CN_Subtype_CIDFontType2
|
static COSName |
CN_Subtype_MMType1
|
static COSName |
CN_Subtype_TrueType
|
static COSName |
CN_Subtype_Type0
|
static COSName |
CN_Subtype_Type1
|
static COSName |
CN_Subtype_Type3
|
static COSName |
CN_Type_Font
|
static COSName |
DK_BaseFont
|
static COSName |
DK_Encoding
|
static COSName |
DK_FirstChar
|
static COSName |
DK_FontDescriptor
|
static COSName |
DK_LastChar
|
static COSName |
DK_Name
|
static COSName |
DK_ToUnicode
|
static COSName |
DK_Widths
|
static PDFont.MetaClass |
META
The meta class instance |
Fields inherited from class de.intarsys.pdf.pd.PDObject |
---|
DK_Subtype, DK_Type |
Method Summary | |
---|---|
void |
dumpFontFile(File file)
|
COSName |
getBaseFont()
|
Encoding |
getEncoding()
The encoding of the glyphs in the font |
int |
getFirstChar()
The first (encoded) codepoint defined in the font. |
PDFontDescriptor |
getFontDescriptor()
The PDFontDescriptor object for this font. |
String |
getFontFamilyName()
|
static String |
getFontFamilyName(String name)
|
String |
getFontName()
|
static String |
getFontName(String name)
extracts the "name" portion from the given font name string |
String |
getFontNameNormalized()
|
PDFontStyle |
getFontStyle()
|
static PDFontStyle |
getFontStyle(String name)
extracts the "style" portion from the given font name |
abstract String |
getFontType()
|
abstract PDGlyphs |
getGlyphsEncoded(int codepoint)
The PDGlyphs instance for the encoded codepoint. |
abstract int |
getGlyphWidthEncoded(int codepoint)
The glyph width of an encoded codepoint in the font. |
int |
getLastChar()
|
String |
getLookupFontFamilyName()
|
String |
getLookupFontName()
|
PDFontStyle |
getLookupFontStyle()
|
int |
getMacintoshRomanCode(int codePoint)
This is a special mapping that is used if we have a font on the physical device using a Macintosh Roman encoding character map. |
int |
getMissingWidth()
|
abstract PDGlyphs |
getNextGlyphsEncoded(ByteArrayInputStream is)
The PDGlyphs denoted by the next byte or bytes in the input
stream. |
CMap |
getToUnicode()
|
void |
invalidateCaches()
Invalidate all local caches as the base object may have changed. |
boolean |
isEmbedded()
Answer true if this font's program is embedded within the document. |
boolean |
isStandardFont()
Answer true if this is one of the 14 standard fonts. |
boolean |
isSubset()
Answer true if this font is partially embedded in the document. |
void |
setBaseFont(String name)
|
void |
setEncoding(Encoding newFontEncoding)
set an encoding for the font |
void |
setFontDescriptor(PDFontDescriptor descriptor)
|
void |
setLookupFontFamilyName(String name)
|
void |
setLookupFontName(String name)
|
void |
setLookupFontStyle(PDFontStyle newStyle)
|
void |
setToUnicode(CMap newToUnicode)
set the to unicode mapping |
String |
toString()
|
Methods inherited from class de.intarsys.pdf.pd.PDObject |
---|
cosGetFieldDescendant, cosGetFieldInheritable, cosGetFieldInherited, cosGetSubtype, cosGetType, cosRemoveFieldInheritable, cosSetFieldInheritable, cosSetSubtype, cosSetType, getDoc, getGenericChildren, getGenericParent, setGenericParent |
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, removeAttribute, setAttribute, setFieldBoolean, setFieldFixed, setFieldInt, setFieldMLString, setFieldName, setFieldObject, setFieldString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final COSName CN_Subtype_CIDFontType0
public static final COSName CN_Subtype_CIDFontType2
public static final COSName CN_Subtype_MMType1
public static final COSName CN_Subtype_TrueType
public static final COSName CN_Subtype_Type0
public static final COSName CN_Subtype_Type1
public static final COSName CN_Subtype_Type3
public static final COSName CN_Type_Font
public static final COSName DK_BaseFont
public static final COSName DK_Encoding
public static final COSName DK_FirstChar
public static final COSName DK_FontDescriptor
public static final COSName DK_LastChar
public static final COSName DK_Name
public static final COSName DK_ToUnicode
public static final COSName DK_Widths
public static final PDFont.MetaClass META
Method Detail |
---|
public static String getFontFamilyName(String name)
public static String getFontName(String name)
name
- a font name
public static PDFontStyle getFontStyle(String name)
name
- a font name
public void dumpFontFile(File file)
public COSName getBaseFont()
public Encoding getEncoding()
public int getFirstChar()
public PDFontDescriptor getFontDescriptor()
PDFontDescriptor
object for this font.
PDFontDescriptor
object for this fontpublic String getFontFamilyName()
public String getFontName()
public String getFontNameNormalized()
public PDFontStyle getFontStyle()
public abstract String getFontType()
public abstract PDGlyphs getGlyphsEncoded(int codepoint)
PDGlyphs
instance for the encoded codepoint.
codepoint
-
PDGlyphs
instance for the encoded codepoint.public abstract int getGlyphWidthEncoded(int codepoint)
In the standard case for single byte encoded fonts, the codepoint is the index in the /Widths array, holding the glyph width.
For multibyte fonts, see PDFontType0
.
codepoint
- The codepoint
public int getLastChar()
public String getLookupFontFamilyName()
public String getLookupFontName()
public PDFontStyle getLookupFontStyle()
public int getMacintoshRomanCode(int codePoint)
See PDF docs, "Encodings for True Type fonts".
codePoint
-
codePoint
public int getMissingWidth()
public abstract PDGlyphs getNextGlyphsEncoded(ByteArrayInputStream is) throws IOException
PDGlyphs
denoted by the next byte or bytes in the input
stream.
For single byte encoded fonts a single byte is read and the associated
PDGlyphs
is returned. For CID fonts, the appropriate number of
bytes is read form the input stream to select the PDGlyphs
.
is
- The input stream on the COSString
bytes
PDGlyphs
referenced by the input stream.
IOException
public CMap getToUnicode()
public void invalidateCaches()
COSBasedObject
invalidateCaches
in class COSBasedObject
public boolean isEmbedded()
public boolean isStandardFont()
public boolean isSubset()
public void setBaseFont(String name)
public void setEncoding(Encoding newFontEncoding)
newFontEncoding
- the new encoding to usepublic void setFontDescriptor(PDFontDescriptor descriptor)
public void setLookupFontFamilyName(String name)
public void setLookupFontName(String name)
public void setLookupFontStyle(PDFontStyle newStyle)
public void setToUnicode(CMap newToUnicode)
newToUnicode
- the new to unicode to usepublic String toString()
toString
in class PDObject
|
jPod PDF library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |