public abstract class PDSimpleFont extends PDFont
Modifier and Type | Field and Description |
---|---|
protected Encoding |
encoding |
protected GlyphList |
glyphList |
private java.lang.Boolean |
isSymbolic |
private static org.apache.commons.logging.Log |
LOG |
private java.util.Set<java.lang.Integer> |
noUnicode |
DEFAULT_FONT_MATRIX, dict
Constructor and Description |
---|
PDSimpleFont()
Constructor for embedding.
|
PDSimpleFont(COSDictionary fontDictionary)
Constructor.
|
PDSimpleFont(java.lang.String baseFont)
Constructor for Standard 14.
|
Modifier and Type | Method and Description |
---|---|
void |
addToSubset(int codePoint)
Adds the given Unicode point to the subset.
|
Encoding |
getEncoding()
Returns the Encoding vector.
|
abstract FontBoxFont |
getFontBoxFont()
Returns the embedded or system font used for rendering.
|
GlyphList |
getGlyphList()
Returns the Encoding vector.
|
abstract java.awt.geom.GeneralPath |
getPath(java.lang.String name)
Returns the path for the character with the given name.
|
protected float |
getStandard14Width(int code)
Returns the glyph width from the AFM if this is a Standard 14 font.
|
protected java.lang.Boolean |
getSymbolicFlag()
Returns the value of the symbolic flag, allowing for the fact that the result may be
indeterminate.
|
boolean |
hasExplicitWidth(int code)
Returns true if the Font dictionary specifies an explicit width for the given glyph.
|
abstract boolean |
hasGlyph(java.lang.String name)
Returns true if the font contains the character with the given name.
|
protected java.lang.Boolean |
isFontSymbolic()
Internal implementation of isSymbolic, allowing for the fact that the result may be
indeterminate.
|
boolean |
isStandard14()
Returns true if this font is one of the "Standard 14" fonts and receives special handling.
|
boolean |
isSymbolic()
Returns true the font is a symbolic (that is, it does not use the Adobe Standard Roman
character set).
|
boolean |
isVertical()
Returns true if the font uses vertical writing mode.
|
protected void |
readEncoding()
Reads the Encoding from the Font dictionary or the embedded or substituted font file.
|
protected abstract Encoding |
readEncodingFromFont()
Called by readEncoding() if the encoding needs to be extracted from the font file.
|
void |
subset()
Replaces this font with a subset containing only the given Unicode characters.
|
java.lang.String |
toUnicode(int code)
Returns the Unicode character sequence which corresponds to the given character code.
|
java.lang.String |
toUnicode(int code,
GlyphList customGlyphList)
Returns the Unicode character sequence which corresponds to the given character code.
|
boolean |
willBeSubset()
Returns true if this font will be subset when embedded.
|
encode, encode, equals, getAverageFontWidth, getCOSObject, getDisplacement, getFontDescriptor, getFontMatrix, getPositionVector, getSpaceWidth, getStandard14AFM, getStringWidth, getSubType, getType, getWidth, getWidths, hashCode, readCMap, readCode, setFontDescriptor, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getBoundingBox, getHeight, getName, getWidthFromFont, isDamaged, isEmbedded
private static final org.apache.commons.logging.Log LOG
protected Encoding encoding
protected GlyphList glyphList
private java.lang.Boolean isSymbolic
private final java.util.Set<java.lang.Integer> noUnicode
PDSimpleFont()
PDSimpleFont(java.lang.String baseFont)
PDSimpleFont(COSDictionary fontDictionary) throws java.io.IOException
fontDictionary
- Font dictionary.java.io.IOException
protected void readEncoding() throws java.io.IOException
java.io.IOException
- if the font file could not be readprotected abstract Encoding readEncodingFromFont() throws java.io.IOException
java.io.IOException
- if the font file could not be read.public Encoding getEncoding()
public GlyphList getGlyphList()
public final boolean isSymbolic()
protected java.lang.Boolean isFontSymbolic()
protected final java.lang.Boolean getSymbolicFlag()
public java.lang.String toUnicode(int code) throws java.io.IOException
PDFont
public java.lang.String toUnicode(int code, GlyphList customGlyphList) throws java.io.IOException
PDFont
public boolean isVertical()
PDFont
isVertical
in class PDFont
protected final float getStandard14Width(int code)
PDFont
getStandard14Width
in class PDFont
code
- character codepublic boolean isStandard14()
PDFont
isStandard14
in class PDFont
public abstract java.awt.geom.GeneralPath getPath(java.lang.String name) throws java.io.IOException
java.io.IOException
- if the path could not be readpublic abstract boolean hasGlyph(java.lang.String name) throws java.io.IOException
java.io.IOException
- if the path could not be readpublic abstract FontBoxFont getFontBoxFont()
public void addToSubset(int codePoint)
PDFont
addToSubset
in class PDFont
codePoint
- Unicode code pointpublic void subset() throws java.io.IOException
PDFont
public boolean willBeSubset()
PDFont
willBeSubset
in class PDFont
public boolean hasExplicitWidth(int code) throws java.io.IOException
PDFontLike
code
- character codejava.io.IOException
- if the font could not be read