|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.icepdf.core.pobjects.Dictionary
org.icepdf.core.pobjects.fonts.Font
public abstract class Font
This class represents a PDF object which has a subtype value equal to "Font". The class does the necessary encoding and Cmap manipulation to allow the proper display of text that uses this font object.
This class is generally only used by the ContentParser for laying out text for display and for text extraction. There are two categories of PDF fonts: Simple and Composite.
There are several types of simple font; all of which have the following properties:
A composite font, also called Type0 font, is one whose glyphs are obtained from a font like object called a CIDFont. A composite font is represented by a font dictionary whose Subtype value is Type0. The Type 0 font is known as the root font, and its associated CID Font is called its descendant.
| Field Summary | |
|---|---|
protected java.lang.String |
basefont
|
static int |
CID_FORMAT
Indicates that the font used to render this String object is in the Composite Font family and thus each glyph is represented by at least one byte. |
protected static java.lang.String[] |
CORE14
|
protected int |
firstchar
|
protected FontFile |
font
|
protected FontDescriptor |
fontDescriptor
|
protected boolean |
inited
|
protected boolean |
isAFMFont
|
protected boolean |
isFontSubstitution
|
protected boolean |
isVerticalWriting
|
protected java.lang.String |
name
|
static int |
SIMPLE_FORMAT
Indicates that the font used to render this String object is in the Simple Font family and thus each glyph is represented by one byte. |
protected java.lang.String |
subtype
|
protected int |
subTypeFormat
|
protected static java.lang.String[][] |
TO_UNICODE
Map named CMap to Unicode mapping. |
protected static java.lang.String[][] |
TYPE1_FONT_NAME
|
| Fields inherited from class org.icepdf.core.pobjects.Dictionary |
|---|
entries, isDeleted, isNew, library, SUBTYPE_KEY, TYPE_KEY |
| Constructor Summary | |
|---|---|
Font(Library library,
java.util.Hashtable entries)
Creates a new instance of a PDF Font. |
|
| Method Summary | |
|---|---|
protected java.lang.String |
getCanonicalName(java.lang.String name)
Gets the base name of the core 14 fonts, null if it does not match |
FontFile |
getFont()
Returns a font which can be used to paint the glyphs in the character set. |
java.lang.String |
getName()
Gets the font name. |
java.lang.String |
getSubType()
Gets the font subtype value. |
int |
getSubTypeFormat()
Gets the font subtype format |
abstract void |
init()
Initiate the font. |
boolean |
isAFMFont()
Indicates that this font is an Adobe Core 14 font. |
boolean |
isCore14(java.lang.String fontName)
Returns true if the font name is one of the core 14 fonts specified by Adobe. |
boolean |
isFontSubstitution()
|
boolean |
isVerticalWriting()
Returns true if the writing mode is vertical; false, otherwise |
java.lang.String |
toString()
String representation of the Font object. |
| Methods inherited from class org.icepdf.core.pobjects.Dictionary |
|---|
getEntries, getFloat, getInt, getLibrary, getNumber, getObject, getObject, getPObjectReference, isDeleted, isNew, setDeleted, setNew, setPObjectReference |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String name
protected java.lang.String basefont
protected java.lang.String subtype
public static final int SIMPLE_FORMAT
Indicates that the font used to render this String object is in the Simple Font family and thus each glyph is represented by one byte.
public static final int CID_FORMAT
Indicates that the font used to render this String object is in the Composite Font family and thus each glyph is represented by at least one byte.
protected int subTypeFormat
protected FontFile font
protected int firstchar
protected FontDescriptor fontDescriptor
protected boolean inited
protected boolean isAFMFont
protected boolean isVerticalWriting
protected boolean isFontSubstitution
protected static final java.lang.String[][] TO_UNICODE
protected static final java.lang.String[] CORE14
protected static final java.lang.String[][] TYPE1_FONT_NAME
| Constructor Detail |
|---|
public Font(Library library,
java.util.Hashtable entries)
library - Libaray of all objects in PDFentries - hash of parsed font attributes| Method Detail |
|---|
public abstract void init()
init in class Dictionaryprotected java.lang.String getCanonicalName(java.lang.String name)
name - name of font to search for canonical namepublic java.lang.String getName()
public java.lang.String getSubType()
public int getSubTypeFormat()
public FontFile getFont()
Returns a font which can be used to paint the glyphs in the character set.
public boolean isVerticalWriting()
Returns true if the writing mode is vertical; false, otherwise
public boolean isAFMFont()
Indicates that this font is an Adobe Core 14 font.
public boolean isFontSubstitution()
public boolean isCore14(java.lang.String fontName)
Returns true if the font name is one of the core 14 fonts specified by Adobe.
fontName - name to test if a core 14 font.
public java.lang.String toString()
toString in class Dictionary
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||