Package org.apache.fontbox.cff
Class CFFExpertSubsetCharset
- java.lang.Object
-
- org.apache.fontbox.cff.CFFExpertSubsetCharset
-
- All Implemented Interfaces:
CFFCharset
public final class CFFExpertSubsetCharset extends java.lang.ObjectThis is specialized CFFCharset. It's used if the CharsetId of a font is set to 2.- Author:
- Villu Ruusmann
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCID(int gid, int cid)Adds a new GID/CID combination to the charset.voidaddSID(int gid, int sid, java.lang.String name)Adds 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.static CFFExpertSubsetCharsetgetInstance()Returns an instance of the CFFExpertSubsetCharset class.java.lang.StringgetNameForGID(int gid)Returns the PostScript glyph name for the given GID.intgetSID(java.lang.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.intgetSIDForGID(int gid)Returns the SID for a given GID.booleanisCIDFont()Indicates if the charset belongs to a CID font.
-
-
-
Method Detail
-
getInstance
public static CFFExpertSubsetCharset getInstance()
Returns an instance of the CFFExpertSubsetCharset class.- Returns:
- an instance of CFFExpertSubsetCharset
-
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
public void addSID(int gid, int sid, java.lang.String name)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 gid)
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:
gid- 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
public int getSID(java.lang.String name)
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
public java.lang.String getNameForGID(int gid)
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
-
-