Top Description Methods
org.apache.fontbox.cff

public Interface CFFCharset

Known Direct Implementers
org.apache.fontbox.cff.CFFCharsetCID, org.apache.fontbox.cff.CFFCharsetType1, org.apache.fontbox.cff.EmbeddedCharset

A CFF charset. A charset is an array of SIDs/CIDs for all glyphs in the font.
Author
John Hewson

Method Summary

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

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
)

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

public int

Returns:

CID
getCIDForGID
(int
GID
gid
)

Returns the CID for the given GID.

public int

Returns:

GID
getGIDForCID
(int
CID
cid
)

Returns the GID for a given CID.

public int

Returns:

GID
getGIDForSID
(int
SID
sid
)

Returns the GID for the given SID.

public String

Returns:

PostScript glyph name
getNameForGID
(int
GID
gid
)

Returns the PostScript glyph name for the given GID.

public int

Returns:

SID
getSID
(String
PostScript glyph name
name
)

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

Returns:

SID
getSIDForGID
(int
GID
gid
)

Returns the SID for a given GID.

public boolean

Returns:

true for CID fonts
isCIDFont
()

Indicates if the charset belongs to a CID font.

Method Detail

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

Adds a new GID/CID combination to the charset.

Parameters
gid:int

GID

cid:int

CID

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

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

getCIDForGIDback to summary
public int getCIDForGID(int gid)

Returns the CID for the given GID.

Parameters
gid:int

GID

Returns:int

CID

getGIDForCIDback to summary
public int getGIDForCID(int cid)

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

Parameters
cid:int

CID

Returns:int

GID

getGIDForSIDback to summary
public int getGIDForSID(int sid)

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

Parameters
sid:int

SID

Returns:int

GID

getNameForGIDback to summary
public String getNameForGID(int gid)

Returns the PostScript glyph name for the given GID.

Parameters
gid:int

GID

Returns:String

PostScript glyph name

getSIDback to summary
public int getSID(String name)

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

getSIDForGIDback to summary
public int getSIDForGID(int gid)

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

Parameters
gid:int

GID

Returns:int

SID

isCIDFontback to summary
public boolean isCIDFont()

Indicates if the charset belongs to a CID font.

Returns:boolean

true for CID fonts