Package org.apache.fontbox.cff
Class CFFFont
java.lang.Object
org.apache.fontbox.cff.CFFFont
- Direct Known Subclasses:
CFFFontROS
This class represents a CFF/Type2 Font.
- Version:
- $Revision$
- Author:
- Villu Ruusmann
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addValueToPrivateDict
(String name, Object value) Adds the given key/value pair to the private dictionary.void
addValueToTopDict
(String name, Object value) Adds the given key/value pair to the top dictionary.Creates a CharStringConverter for this font.Creates a CharStringRenderer for this font.Returns the CFFCharset of the font.Returns the character strings dictionary.Returns the CFFEncoding of the font.Returns the global subroutine index data.Returns the local subroutine index data.Get the mapping (code/SID/charname/bytes) for this font.getName()
The name of the font.protected int
getNotDefWidth
(int defaultWidth, int nominalWidth) Returns the private dictionary.getProperty
(String name) Returns the value for the given name from the dictionary.Returns the top dictionary.int
getWidth
(int SID) Return the Width value of the given Glyph identifiervoid
setCharset
(CFFCharset charset) Sets the CFFCharset of the font.void
setEncoding
(CFFEncoding encoding) Sets the CFFEncoding of the font.void
setGlobalSubrIndex
(IndexData globalSubrIndex) Sets the global subroutine index data.void
setLocalSubrIndex
(IndexData localSubrIndex) Sets the local subroutine index data.void
Sets the name of the font.toString()
-
Constructor Details
-
CFFFont
public CFFFont()
-
-
Method Details
-
getName
The name of the font.- Returns:
- the name of the font
-
setName
Sets the name of the font.- Parameters:
name
- the name of the font
-
getProperty
Returns the value for the given name from the dictionary.- Parameters:
name
- the name of the value- Returns:
- the value of the name if available
-
addValueToTopDict
Adds the given key/value pair to the top dictionary.- Parameters:
name
- the given keyvalue
- the given value
-
getTopDict
Returns the top dictionary.- Returns:
- the dictionary
-
addValueToPrivateDict
Adds the given key/value pair to the private dictionary.- Parameters:
name
- the given keyvalue
- the given value
-
getPrivateDict
Returns the private dictionary.- Returns:
- the dictionary
-
getMappings
Get the mapping (code/SID/charname/bytes) for this font.- Returns:
- mappings for codes < 256 and for codes >= 256
-
getWidth
Return the Width value of the given Glyph identifier- Parameters:
SID
-- Returns:
- -1 if the SID is missing from the Font.
- Throws:
IOException
-
getNotDefWidth
- Throws:
IOException
-
getEncoding
Returns the CFFEncoding of the font.- Returns:
- the encoding
-
setEncoding
Sets the CFFEncoding of the font.- Parameters:
encoding
- the given CFFEncoding
-
getCharset
Returns the CFFCharset of the font.- Returns:
- the charset
-
setCharset
Sets the CFFCharset of the font.- Parameters:
charset
- the given CFFCharset
-
getCharStringsDict
Returns the character strings dictionary.- Returns:
- the dictionary
-
createConverter
Creates a CharStringConverter for this font.- Returns:
- the new CharStringConverter
-
createRenderer
Creates a CharStringRenderer for this font.- Returns:
- the new CharStringRenderer
-
toString
-
setGlobalSubrIndex
Sets the global subroutine index data.- Parameters:
globalSubrIndex
- the IndexData object containing the global subroutines
-
getGlobalSubrIndex
Returns the global subroutine index data.- Returns:
- the dictionary
-
getLocalSubrIndex
Returns the local subroutine index data.- Returns:
- the dictionary
-
setLocalSubrIndex
Sets the local subroutine index data.- Parameters:
localSubrIndex
- the IndexData object containing the local subroutines
-