Package org.apache.fontbox.cff
Class CFFCharset
- java.lang.Object
-
- org.apache.fontbox.cff.CFFCharset
-
- Direct Known Subclasses:
CFFExpertCharset
,CFFExpertSubsetCharset
,CFFISOAdobeCharset
public abstract class CFFCharset extends java.lang.Object
A CFF charset. A charset is an array of SIDs/CIDs for all glyphs in the font. todo: split this into two? CFFCharsetType1 and CFFCharsetCID ?- Author:
- John Hewson
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCID(int gid, int cid)
Adds a new GID/CID combination to the charset.void
addSID(int gid, int sid, java.lang.String name)
Adds a new GID/SID/name combination to the charset.int
getCIDForGID(int gid)
Returns the CID for the given GID.int
getGIDForCID(int cid)
Returns the GID for a given CID.java.lang.String
getNameForGID(int gid)
Returns the PostScript glyph name for the given GID.boolean
isCIDFont()
Indicates if the charset belongs to a CID font.
-
-
-
Method Detail
-
isCIDFont
public boolean isCIDFont()
Indicates if the charset belongs to a CID font.- Returns:
- true for CID fonts
-
addSID
public void addSID(int gid, int sid, java.lang.String name)
Adds a new GID/SID/name combination to the charset.- Parameters:
gid
- GIDsid
- SID
-
addCID
public void addCID(int gid, int cid)
Adds a new GID/CID combination to the charset.- Parameters:
gid
- GIDcid
- CID
-
getGIDForCID
public int getGIDForCID(int cid)
Returns the GID for a given CID. Returns 0 if the CID is missing.- Parameters:
cid
- CID- Returns:
- GID
-
getNameForGID
public java.lang.String getNameForGID(int gid)
Returns the PostScript glyph name for the given GID.- Parameters:
gid
- GID- Returns:
- PostScript glyph name
-
getCIDForGID
public int getCIDForGID(int gid)
Returns the CID for the given GID.- Parameters:
gid
- GID- Returns:
- CID
-
-