|
|||||||||
| 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 Name |
BASEFONT_KEY
|
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
|
static Name |
ENCODING_KEY
|
static Name |
FIRST_CHAR_KEY
|
protected int |
firstchar
|
protected FontFile |
font
|
protected FontDescriptor |
fontDescriptor
|
protected boolean |
inited
|
protected boolean |
isAFMFont
|
protected boolean |
isFontSubstitution
|
protected boolean |
isVerticalWriting
|
static Name |
LAST_CHAR_KEY
|
protected int |
lastchar
|
protected Name |
name
|
static Name |
NAME_KEY
|
protected Resources |
parentResource
|
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 Name |
subtype
|
protected int |
subTypeFormat
|
protected static java.lang.String[][] |
TO_UNICODE
Map named CMap to Unicode mapping. |
static Name |
TYPE
|
protected static java.lang.String[][] |
TYPE1_FONT_NAME
|
| Fields inherited from class org.icepdf.core.pobjects.Dictionary |
|---|
entries, FORM_TYPE_KEY, isDeleted, isNew, LENGTH_KEY, library, SUBTYPE_KEY, TYPE_KEY |
| Constructor Summary | |
|---|---|
Font(Library library,
java.util.HashMap entries)
Creates a new instance of a PDF Font. |
|
| Method Summary | |
|---|---|
java.lang.String |
getBaseFont()
Gets the fonts base name. |
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. |
Name |
getName()
Gets the font name. |
Resources |
getParentResource()
|
Name |
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 |
void |
setParentResource(Resources parentResource)
|
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, 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 |
|---|
public static final Name TYPE
public static final Name NAME_KEY
public static final Name BASEFONT_KEY
public static final Name ENCODING_KEY
public static final Name FIRST_CHAR_KEY
public static final Name LAST_CHAR_KEY
protected Name name
protected java.lang.String basefont
protected Name 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 int lastchar
protected FontDescriptor fontDescriptor
protected boolean inited
protected boolean isAFMFont
protected boolean isVerticalWriting
protected boolean isFontSubstitution
protected Resources parentResource
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.HashMap 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 getBaseFont()
public Name getName()
public Name 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 Dictionarypublic Resources getParentResource()
public void setParentResource(Resources parentResource)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||