Package org.apache.fontbox.cff
Class EmbeddedCharset
- java.lang.Object
-
- org.apache.fontbox.cff.EmbeddedCharset
-
- All Implemented Interfaces:
CFFCharset
- Direct Known Subclasses:
CFFParser.Format0Charset,CFFParser.Format1Charset,CFFParser.Format2Charset
class EmbeddedCharset extends java.lang.Object implements CFFCharset
Class representing an embedded CFF charset.
-
-
Field Summary
Fields Modifier and Type Field Description private CFFCharsetcharset
-
Constructor Summary
Constructors Constructor Description EmbeddedCharset(boolean isCIDFont)
-
Method Summary
All 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.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 sid)Returns the SID for a given GID.booleanisCIDFont()Indicates if the charset belongs to a CID font.
-
-
-
Field Detail
-
charset
private final CFFCharset charset
-
-
Method Detail
-
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
-
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 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
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
-
-