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

pack-priv Class CFFCharsetType1

extends Object
implements CFFCharset
Class Inheritance
All Implemented Interfaces
org.apache.fontbox.cff.CFFCharset
Known Direct Subclasses
org.apache.fontbox.cff.CFFExpertCharset, org.apache.fontbox.cff.CFFExpertSubsetCharset, org.apache.fontbox.cff.CFFISOAdobeCharset, org.apache.fontbox.cff.CFFParser.EmptyCharsetType1
Imports
java.util.HashMap, .Map

A CFF charset. A charset is an array of CIDs for all glyphs in the font.
Author
Valery Bokov

Field Summary

Modifier and TypeField and Description
private static final String
private final Map<Integer, String>
private final Map<Integer, Integer>
private final Map<String, Integer>
private final Map<Integer, Integer>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
addCID(int
GID
gid
,
int
CID
cid
)

Implements org.apache.fontbox.cff.CFFCharset.addCID.

Adds a new GID/CID combination to the charset.

public void
addSID(int
GID
gid
,
int
SID
sid
,
String
the postscript name of the glyph
name
)

Implements org.apache.fontbox.cff.CFFCharset.addSID.

Adds a new GID/SID/name combination to the charset.

public int
getCIDForGID(int
GID
gid
)

Implements org.apache.fontbox.cff.CFFCharset.getCIDForGID.

Returns the CID for the given GID.

public int
getGIDForCID(int
CID
cid
)

Implements org.apache.fontbox.cff.CFFCharset.getGIDForCID.

Returns the GID for a given CID.

public int
getGIDForSID(int
SID
sid
)

Implements org.apache.fontbox.cff.CFFCharset.getGIDForSID.

Returns the GID for the given SID.

public String
getNameForGID(int
GID
gid
)

Implements org.apache.fontbox.cff.CFFCharset.getNameForGID.

Returns the PostScript glyph name for the given GID.

public int
getSID(String
PostScript glyph name
name
)

Implements org.apache.fontbox.cff.CFFCharset.getSID.

Returns the SID for a given PostScript name, you would think this is not needed, but some fonts have glyphs beyond their encoding with charset SID names.

public int
getSIDForGID(int
GID
gid
)

Implements org.apache.fontbox.cff.CFFCharset.getSIDForGID.

Returns the SID for a given GID.

public boolean
isCIDFont()

Implements org.apache.fontbox.cff.CFFCharset.isCIDFont.

Indicates if the charset belongs to a CID font.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EXCEPTION_MESSAGEback to summary
private static final String EXCEPTION_MESSAGE
gidToNameback to summary
private final Map<Integer, String> gidToName
gidToSidback to summary
private final Map<Integer, Integer> gidToSid
nameToSidback to summary
private final Map<String, Integer> nameToSid
sidOrCidToGidback to summary
private final Map<Integer, Integer> sidOrCidToGid

Constructor Detail

CFFCharsetType1back to summary
pack-priv CFFCharsetType1()

Method Detail

addCIDback to summary
public void addCID(int gid, int cid)

Implements org.apache.fontbox.cff.CFFCharset.addCID.

Doc from org.apache.fontbox.cff.CFFCharset.addCID.

Adds a new GID/CID combination to the charset.

Parameters
gid:int

GID

cid:int

CID

Annotations
@Override
addSIDback to summary
public void addSID(int gid, int sid, String name)

Implements org.apache.fontbox.cff.CFFCharset.addSID.

Doc from org.apache.fontbox.cff.CFFCharset.addSID.

Adds a new GID/SID/name combination to the charset.

Parameters
gid:int

GID

sid:int

SID

name:String

the postscript name of the glyph

Annotations
@Override
getCIDForGIDback to summary
public int getCIDForGID(int gid)

Implements org.apache.fontbox.cff.CFFCharset.getCIDForGID.

Doc from org.apache.fontbox.cff.CFFCharset.getCIDForGID.

Returns the CID for the given GID.

Parameters
gid:int

GID

Returns:int

CID

Annotations
@Override
getGIDForCIDback to summary
public int getGIDForCID(int cid)

Implements org.apache.fontbox.cff.CFFCharset.getGIDForCID.

Doc from org.apache.fontbox.cff.CFFCharset.getGIDForCID.

Returns the GID for a given CID. Returns 0 if the CID is missing.

Parameters
cid:int

CID

Returns:int

GID

Annotations
@Override
getGIDForSIDback to summary
public int getGIDForSID(int sid)

Implements org.apache.fontbox.cff.CFFCharset.getGIDForSID.

Doc from org.apache.fontbox.cff.CFFCharset.getGIDForSID.

Returns the GID for the given SID. SIDs are internal to the font and are not public.

Parameters
sid:int

SID

Returns:int

GID

Annotations
@Override
getNameForGIDback to summary
public String getNameForGID(int gid)

Implements org.apache.fontbox.cff.CFFCharset.getNameForGID.

Doc from org.apache.fontbox.cff.CFFCharset.getNameForGID.

Returns the PostScript glyph name for the given GID.

Parameters
gid:int

GID

Returns:String

PostScript glyph name

Annotations
@Override
getSIDback to summary
public int getSID(String name)

Implements org.apache.fontbox.cff.CFFCharset.getSID.

Doc from org.apache.fontbox.cff.CFFCharset.getSID.

Returns the SID for a given PostScript name, you would think this is not needed, but some fonts have glyphs beyond their encoding with charset SID names.

Parameters
name:String

PostScript glyph name

Returns:int

SID

Annotations
@Override
getSIDForGIDback to summary
public int getSIDForGID(int gid)

Implements org.apache.fontbox.cff.CFFCharset.getSIDForGID.

Doc from org.apache.fontbox.cff.CFFCharset.getSIDForGID.

Returns the SID for a given GID. SIDs are internal to the font and are not public.

Parameters
gid:int

GID

Returns:int

SID

Annotations
@Override
isCIDFontback to summary
public boolean isCIDFont()

Implements org.apache.fontbox.cff.CFFCharset.isCIDFont.

Doc from org.apache.fontbox.cff.CFFCharset.isCIDFont.

Indicates if the charset belongs to a CID font.

Returns:boolean

true for CID fonts

Annotations
@Override