Package org.apache.fontbox.cff
Class CFFCharsetCID
java.lang.Object
org.apache.fontbox.cff.CFFCharsetCID
- All Implemented Interfaces:
CFFCharset
- Direct Known Subclasses:
CFFParser.EmptyCharsetCID
A CFF charset. A charset is an array of CIDs for all glyphs in the font.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCID(int gid, int cid) Adds a new GID/CID combination to the charset.voidAdds a new GID/SID/name combination to the charset.intgetCIDForGID(int gid) Returns the CID for the given GID.intgetGIDForCID(int cid) Returns the GID for a given CID.intgetGIDForSID(int sid) Returns the GID for the given SID.getNameForGID(int gid) Returns the PostScript glyph name for the given GID.intReturns 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.intgetSIDForGID(int sid) Returns the SID for a given GID.booleanIndicates if the charset belongs to a CID font.
-
Field Details
-
EXCEPTION_MESSAGE
- See Also:
-
sidOrCidToGid
-
gidToCid
-
-
Constructor Details
-
CFFCharsetCID
CFFCharsetCID()
-
-
Method Details
-
isCIDFont
public boolean isCIDFont()Description copied from interface:CFFCharsetIndicates if the charset belongs to a CID font.- Specified by:
isCIDFontin interfaceCFFCharset- Returns:
- true for CID fonts
-
addSID
Description copied from interface:CFFCharsetAdds a new GID/SID/name combination to the charset.- Specified by:
addSIDin interfaceCFFCharset- Parameters:
gid- GIDsid- SIDname- the postscript name of the glyph
-
addCID
public void addCID(int gid, int cid) Description copied from interface:CFFCharsetAdds a new GID/CID combination to the charset.- Specified by:
addCIDin interfaceCFFCharset- Parameters:
gid- GIDcid- CID
-
getSIDForGID
public int getSIDForGID(int sid) Description copied from interface:CFFCharsetReturns the SID for a given GID. SIDs are internal to the font and are not public.- Specified by:
getSIDForGIDin interfaceCFFCharset- Parameters:
sid- GID- Returns:
- SID
-
getGIDForSID
public int getGIDForSID(int sid) Description copied from interface:CFFCharsetReturns the GID for the given SID. SIDs are internal to the font and are not public.- Specified by:
getGIDForSIDin interfaceCFFCharset- Parameters:
sid- SID- Returns:
- GID
-
getGIDForCID
public int getGIDForCID(int cid) Description copied from interface:CFFCharsetReturns the GID for a given CID. Returns 0 if the CID is missing.- Specified by:
getGIDForCIDin interfaceCFFCharset- Parameters:
cid- CID- Returns:
- GID
-
getSID
Description copied from interface:CFFCharsetReturns 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.- Specified by:
getSIDin interfaceCFFCharset- Parameters:
name- PostScript glyph name- Returns:
- SID
-
getNameForGID
Description copied from interface:CFFCharsetReturns the PostScript glyph name for the given GID.- Specified by:
getNameForGIDin interfaceCFFCharset- Parameters:
gid- GID- Returns:
- PostScript glyph name
-
getCIDForGID
public int getCIDForGID(int gid) Description copied from interface:CFFCharsetReturns the CID for the given GID.- Specified by:
getCIDForGIDin interfaceCFFCharset- Parameters:
gid- GID- Returns:
- CID
-