Top Description Fields Constructors Methods
org.apache.fontbox.cff

public abstract Class CFFFont

extends Object
implements FontBoxFont
Class Inheritance
All Implemented Interfaces
org.apache.fontbox.FontBoxFont
Known Direct Subclasses
org.apache.fontbox.cff.CFFType1Font, org.apache.fontbox.cff.CFFCIDFont
Imports
java.io.IOException, java.util.Arrays, .LinkedHashMap, .List, .Map, org.apache.fontbox.FontBoxFont, org.apache.fontbox.util.BoundingBox

An Adobe Compact Font Format (CFF) font. Thread safe.
Authors
Villu Ruusmann, John Hewson

Field Summary

Modifier and TypeField and Description
private CFFCharset
protected byte[][]
private String
protected byte[][]
private CFFParser.ByteSource
protected final Map<String, Object>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addValueToTopDict(String
the given key
name
,
Object
the given value
value
)

Adds the given key/value pair to the top dictionary.

public CFFCharset

Returns:

the charset
getCharset
()

Returns the CFFCharset of the font.

public final List<byte[]>

Returns:

the character strings dictionary as a list of byte arrays.
getCharStringBytes
()

Returns the character strings dictionary.

public byte[]

Returns:

the cff data as byte array
getData
()

Returns the CFF data.

public BoundingBox
getFontBBox()

Implements org.apache.fontbox.FontBoxFont.getFontBBox.

Returns the FontBBox.

public List<Number>
getFontMatrix()

Implements org.apache.fontbox.FontBoxFont.getFontMatrix.

Returns the FontMatrix.

public List<byte[]>

Returns:

a list of the global subroutines.
getGlobalSubrIndex
()

Returns the list containing the global subroutines.

public String

Returns:

the name of the font
getName
()

Implements org.apache.fontbox.FontBoxFont.getName.

The name of the font.

public int

Returns:

the number of charstrings
getNumCharStrings
()

Returns the number of charstrings in the font.

public Map<String, Object>

Returns:

the dictionary
getTopDict
()

Returns the top dictionary.

public abstract Type2CharString

Returns:

the Type2 charstring of the given cid/gid
getType2CharString
(int
CID for CIFFont, or GID for Type 1 font
cidOrGid
)

Returns the Type 2 charstring for the given CID.

pack-priv void
setCharset(CFFCharset
the given CFFCharset
charset
)

Sets the CFFCharset of the font.

pack-priv final void
setData(CFFParser.ByteSource source)

Sets a byte source to re-read the CFF data in the future.

pack-priv void
setGlobalSubrIndex(byte[][]
a list of the global subroutines.
globalSubrIndexValue
)

Sets the global subroutine index data.

pack-priv void
setName(String
the name of the font
name
)

Sets the name of the font.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

charsetback to summary
private CFFCharset charset
charStringsback to summary
protected byte[][] charStrings
fontNameback to summary
private String fontName
globalSubrIndexback to summary
protected byte[][] globalSubrIndex
sourceback to summary
private CFFParser.ByteSource source
topDictback to summary
protected final Map<String, Object> topDict

Constructor Detail

CFFFontback to summary
public CFFFont()

Method Detail

addValueToTopDictback to summary
public void addValueToTopDict(String name, Object value)

Adds the given key/value pair to the top dictionary.

Parameters
name:String

the given key

value:Object

the given value

getCharsetback to summary
public CFFCharset getCharset()

Returns the CFFCharset of the font.

Returns:CFFCharset

the charset

getCharStringBytesback to summary
public final List<byte[]> getCharStringBytes()

Returns the character strings dictionary. For expert users only.

Returns:List<byte[]>

the character strings dictionary as a list of byte arrays.

getDataback to summary
public byte[] getData() throws IOException

Returns the CFF data.

Returns:byte[]

the cff data as byte array

Exceptions
IOException:
if the data could not be read
getFontBBoxback to summary
public BoundingBox getFontBBox() throws IOException

Implements org.apache.fontbox.FontBoxFont.getFontBBox.

Returns the FontBBox.

Returns:BoundingBox

Doc from org.apache.fontbox.FontBoxFont.getFontBBox.

the bounding box of the font

Annotations
@Override
Exceptions
IOException:
if there are less than 4 numbers
getFontMatrixback to summary
public List<Number> getFontMatrix()

Implements org.apache.fontbox.FontBoxFont.getFontMatrix.

Returns the FontMatrix.

Returns:List<Number>

Doc from org.apache.fontbox.FontBoxFont.getFontMatrix.

the font matrix

Annotations
@Override
getGlobalSubrIndexback to summary
public List<byte[]> getGlobalSubrIndex()

Returns the list containing the global subroutines.

Returns:List<byte[]>

a list of the global subroutines.

getNameback to summary
public String getName()

Implements org.apache.fontbox.FontBoxFont.getName.

The name of the font.

Returns:String

the name of the font

Annotations
@Override
getNumCharStringsback to summary
public int getNumCharStrings()

Returns the number of charstrings in the font.

Returns:int

the number of charstrings

getTopDictback to summary
public Map<String, Object> getTopDict()

Returns the top dictionary.

Returns:Map<String, Object>

the dictionary

getType2CharStringback to summary
public abstract Type2CharString getType2CharString(int cidOrGid) throws IOException

Returns the Type 2 charstring for the given CID.

Parameters
cidOrGid:int

CID for CIFFont, or GID for Type 1 font

Returns:Type2CharString

the Type2 charstring of the given cid/gid

Exceptions
IOException:
if the charstring could not be read
setCharsetback to summary
pack-priv void setCharset(CFFCharset charset)

Sets the CFFCharset of the font.

Parameters
charset:CFFCharset

the given CFFCharset

setDataback to summary
pack-priv final void setData(CFFParser.ByteSource source)

Sets a byte source to re-read the CFF data in the future.

setGlobalSubrIndexback to summary
pack-priv void setGlobalSubrIndex(byte[][] globalSubrIndexValue)

Sets the global subroutine index data.

Parameters
globalSubrIndexValue:byte[][]

a list of the global subroutines.

setNameback to summary
pack-priv void setName(String name)

Sets the name of the font.

Parameters
name:String

the name of the font

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override