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

public Class CFFCIDFont

extends CFFFont
Class Inheritance
Imports
java.awt.geom.GeneralPath, java.io.IOException, java.util.Collections, .List, .Locale, .Map, java.util.concurrent.ConcurrentHashMap, org.apache.fontbox.type1.Type1CharStringReader

A Type 0 CIDFont represented in a CFF file. Thread safe.
Authors
Villu Ruusmann, John Hewson

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
CFFCIDFont.PrivateType1CharStringReader

Private implementation of Type1CharStringReader, because only CFFType1Font can expose this publicly, as CIDFonts only support this for legacy 'seac' commands.

Field Summary

Modifier and TypeField and Description
private final Map<Integer, CIDKeyedType2CharString>
private Type2CharStringParser
private FDSelect
private List<Map<String, Object>>
private String
private List<Map<String, Object>>
private final CFFCIDFont.PrivateType1CharStringReader
private String
private int
Inherited from org.apache.fontbox.cff.CFFFont:
charStringsglobalSubrIndextopDict

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private int
getDefaultWidthX(int
GID
gid
)

Returns the defaultWidthX for the given GID.

public FDSelect

Returns:

the fdSelect
getFdSelect
()

Returns the fdSelect value.

public List<Map<String, Object>>

Returns:

the fontDict
getFontDicts
()

Returns the font dictionaries.

private byte[][]
getLocalSubrIndex(int
GID
gid
)

Returns the LocalSubrIndex for the given GID.

private int
getNominalWidthX(int
GID
gid
)

Returns the nominalWidthX for the given GID.

public String

Returns:

the ordering
getOrdering
()

Returns the ordering value.

private Type2CharStringParser
public GeneralPath
getPath(String
PostScript glyph name
selector
)

Implements org.apache.fontbox.FontBoxFont.getPath.

Returns the path for the character with the given name.

public List<Map<String, Object>>

Returns:

the privDict
getPrivDicts
()

Returns the private dictionary.

public String

Returns:

the registry
getRegistry
()

Returns the registry value.

public int

Returns:

the supplement
getSupplement
()

Returns the supplement value.

public CIDKeyedType2CharString
getType2CharString(int
CID
cid
)

Implements abstract org.apache.fontbox.cff.CFFFont.getType2CharString.

Returns the Type 2 charstring for the given CID.

public float
getWidth(String
PostScript glyph name
selector
)

Implements org.apache.fontbox.FontBoxFont.getWidth.

Returns the advance width for the character with the given name.

public boolean
hasGlyph(String
PostScript glyph name
selector
)

Implements org.apache.fontbox.FontBoxFont.hasGlyph.

Returns true if the font contains the given glyph.

private int
selectorToCID(String selector)

Parses a CID selector of the form \ddddd.

pack-priv void
setFdSelect(FDSelect
the fdSelect to set
fdSelect
)

Sets the fdSelect value.

pack-priv void
setFontDict(List<Map<String, Object>>
the fontDict to set
fontDict
)

Sets the font dictionaries.

pack-priv void
setOrdering(String
the ordering to set
ordering
)

Sets the ordering value.

pack-priv void
setPrivDict(List<Map<String, Object>>
the privDict to set
privDict
)

Sets the private dictionary.

pack-priv void
setRegistry(String
the registry to set
registry
)

Sets the registry value.

pack-priv void
setSupplement(int
the supplement to set
supplement
)

Sets the supplement value.

Inherited from org.apache.fontbox.cff.CFFFont:
addValueToTopDictgetCharsetgetCharStringBytesgetDatagetFontBBoxgetFontMatrixgetGlobalSubrIndexgetNamegetNumCharStringsgetTopDictsetCharsetsetDatasetGlobalSubrIndexsetNametoString

Field Detail

charStringCacheback to summary
private final Map<Integer, CIDKeyedType2CharString> charStringCache
charStringParserback to summary
private Type2CharStringParser charStringParser
fdSelectback to summary
private FDSelect fdSelect
fontDictionariesback to summary
private List<Map<String, Object>> fontDictionaries
orderingback to summary
private String ordering
privateDictionariesback to summary
private List<Map<String, Object>> privateDictionaries
readerback to summary
private final CFFCIDFont.PrivateType1CharStringReader reader
registryback to summary
private String registry
supplementback to summary
private int supplement

Constructor Detail

CFFCIDFontback to summary
public CFFCIDFont()

Method Detail

getDefaultWidthXback to summary
private int getDefaultWidthX(int gid)

Returns the defaultWidthX for the given GID.

Parameters
gid:int

GID

getFdSelectback to summary
public FDSelect getFdSelect()

Returns the fdSelect value.

Returns:FDSelect

the fdSelect

getFontDictsback to summary
public List<Map<String, Object>> getFontDicts()

Returns the font dictionaries.

Returns:List<Map<String, Object>>

the fontDict

getLocalSubrIndexback to summary
private byte[][] getLocalSubrIndex(int gid)

Returns the LocalSubrIndex for the given GID.

Parameters
gid:int

GID

getNominalWidthXback to summary
private int getNominalWidthX(int gid)

Returns the nominalWidthX for the given GID.

Parameters
gid:int

GID

getOrderingback to summary
public String getOrdering()

Returns the ordering value.

Returns:String

the ordering

getParserback to summary
private Type2CharStringParser getParser()
getPathback to summary
public GeneralPath getPath(String selector) throws IOException

Implements org.apache.fontbox.FontBoxFont.getPath.

Doc from org.apache.fontbox.FontBoxFont.getPath.

Returns the path for the character with the given name.

Parameters
selector:String

PostScript glyph name

Returns:GeneralPath

glyph path

Annotations
@Override
Exceptions
IOException:
if the path could not be read
getPrivDictsback to summary
public List<Map<String, Object>> getPrivDicts()

Returns the private dictionary.

Returns:List<Map<String, Object>>

the privDict

getRegistryback to summary
public String getRegistry()

Returns the registry value.

Returns:String

the registry

getSupplementback to summary
public int getSupplement()

Returns the supplement value.

Returns:int

the supplement

getType2CharStringback to summary
public CIDKeyedType2CharString getType2CharString(int cid) throws IOException

Implements abstract org.apache.fontbox.cff.CFFFont.getType2CharString.

Returns the Type 2 charstring for the given CID.

Parameters
cid:int

CID

Returns:CIDKeyedType2CharString

Doc from org.apache.fontbox.cff.CFFFont.getType2CharString.

the Type2 charstring of the given cid/gid

Annotations
@Override
Exceptions
IOException:
if the charstring could not be read
getWidthback to summary
public float getWidth(String selector) throws IOException

Implements org.apache.fontbox.FontBoxFont.getWidth.

Doc from org.apache.fontbox.FontBoxFont.getWidth.

Returns the advance width for the character with the given name.

Parameters
selector:String

PostScript glyph name

Returns:float

glyph advance width

Annotations
@Override
Exceptions
IOException:
if the path could not be read
hasGlyphback to summary
public boolean hasGlyph(String selector) throws IOException

Implements org.apache.fontbox.FontBoxFont.hasGlyph.

Doc from org.apache.fontbox.FontBoxFont.hasGlyph.

Returns true if the font contains the given glyph.

Parameters
selector:String

PostScript glyph name

Returns:boolean

true if the font contains a glyph with the given name, otherwise false

Annotations
@Override
Exceptions
IOException:
if something went wrong when accessing the font data
selectorToCIDback to summary
private int selectorToCID(String selector)

Parses a CID selector of the form \ddddd.

setFdSelectback to summary
pack-priv void setFdSelect(FDSelect fdSelect)

Sets the fdSelect value.

Parameters
fdSelect:FDSelect

the fdSelect to set

setFontDictback to summary
pack-priv void setFontDict(List<Map<String, Object>> fontDict)

Sets the font dictionaries.

Parameters
fontDict:List<Map<String, Object>>

the fontDict to set

setOrderingback to summary
pack-priv void setOrdering(String ordering)

Sets the ordering value.

Parameters
ordering:String

the ordering to set

setPrivDictback to summary
pack-priv void setPrivDict(List<Map<String, Object>> privDict)

Sets the private dictionary.

Parameters
privDict:List<Map<String, Object>>

the privDict to set

setRegistryback to summary
pack-priv void setRegistry(String registry)

Sets the registry value.

Parameters
registry:String

the registry to set

setSupplementback to summary
pack-priv void setSupplement(int supplement)

Sets the supplement value.

Parameters
supplement:int

the supplement to set

org.apache.fontbox.cff back to summary

private Class CFFCIDFont.PrivateType1CharStringReader

extends Object
implements Type1CharStringReader
Class Inheritance
  • java.lang.Object
  • org.apache.fontbox.cff.CFFCIDFont.PrivateType1CharStringReader
All Implemented Interfaces
org.apache.fontbox.type1.Type1CharStringReader

Private implementation of Type1CharStringReader, because only CFFType1Font can expose this publicly, as CIDFonts only support this for legacy 'seac' commands.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Type1CharString
getType1CharString(String
the character name of the Type1 charstring
name
)

Implements org.apache.fontbox.type1.Type1CharStringReader.getType1CharString.

Returns the Type 1 CharString for the character with the given name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PrivateType1CharStringReaderback to summary
private PrivateType1CharStringReader()

Method Detail

getType1CharStringback to summary
public Type1CharString getType1CharString(String name) throws IOException

Implements org.apache.fontbox.type1.Type1CharStringReader.getType1CharString.

Doc from org.apache.fontbox.type1.Type1CharStringReader.getType1CharString.

Returns the Type 1 CharString for the character with the given name.

Parameters
name:String

the character name of the Type1 charstring

Returns:Type1CharString

Type 1 CharString

Annotations
@Override
Exceptions
IOException:
if something went wrong