Class GlyphList
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.font.encoding.GlyphList
-
public final class GlyphList extends java.lang.ObjectPostScript glyph list, maps glyph names to sequences of Unicode characters. Instances of GlyphList are immutable.
-
-
Field Summary
Fields Modifier and Type Field Description private static GlyphListDEFAULTprivate static org.apache.commons.logging.LogLOGprivate java.util.Map<java.lang.String,java.lang.String>nameToUnicodeprivate java.util.Map<java.lang.String,java.lang.String>unicodeToNameprivate java.util.Map<java.lang.String,java.lang.String>uniNameToUnicodeCacheprivate static GlyphListZAPF_DINGBATS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringcodePointToName(int codePoint)Returns the name for the given Unicode code point.static GlyphListgetAdobeGlyphList()Returns the Adobe Glyph List (AGL).static GlyphListgetZapfDingbats()Returns the Zapf Dingbats glyph list.private static GlyphListload(java.lang.String filename, int numberOfEntries)Loads a glyph list from disk.private voidloadList(java.io.InputStream input)java.lang.StringsequenceToName(java.lang.String unicodeSequence)Returns the name for a given sequence of Unicode characters.java.lang.StringtoUnicode(java.lang.String name)Returns the Unicode character sequence for the given glyph name, or null if there isn't any.
-
-
-
Field Detail
-
LOG
private static final org.apache.commons.logging.Log LOG
-
DEFAULT
private static final GlyphList DEFAULT
-
ZAPF_DINGBATS
private static final GlyphList ZAPF_DINGBATS
-
nameToUnicode
private final java.util.Map<java.lang.String,java.lang.String> nameToUnicode
-
unicodeToName
private final java.util.Map<java.lang.String,java.lang.String> unicodeToName
-
uniNameToUnicodeCache
private final java.util.Map<java.lang.String,java.lang.String> uniNameToUnicodeCache
-
-
Constructor Detail
-
GlyphList
public GlyphList(java.io.InputStream input, int numberOfEntries) throws java.io.IOExceptionCreates a new GlyphList from a glyph list file.- Parameters:
numberOfEntries- number of expected values used to preallocate the correct amount of memoryinput- glyph list in Adobe format- Throws:
java.io.IOException- if the glyph list could not be read
-
GlyphList
public GlyphList(GlyphList glyphList, java.io.InputStream input) throws java.io.IOException
Creates a new GlyphList from multiple glyph list files.- Parameters:
glyphList- an existing glyph list to be copiedinput- glyph list in Adobe format- Throws:
java.io.IOException- if the glyph list could not be read
-
-
Method Detail
-
load
private static GlyphList load(java.lang.String filename, int numberOfEntries)
Loads a glyph list from disk.
-
getAdobeGlyphList
public static GlyphList getAdobeGlyphList()
Returns the Adobe Glyph List (AGL).- Returns:
- the Adobe glyph list
-
getZapfDingbats
public static GlyphList getZapfDingbats()
Returns the Zapf Dingbats glyph list.- Returns:
- the Zapf Dingbats glyph list
-
loadList
private void loadList(java.io.InputStream input) throws java.io.IOException- Throws:
java.io.IOException
-
codePointToName
public java.lang.String codePointToName(int codePoint)
Returns the name for the given Unicode code point.- Parameters:
codePoint- Unicode code point- Returns:
- PostScript glyph name, or ".notdef"
-
sequenceToName
public java.lang.String sequenceToName(java.lang.String unicodeSequence)
Returns the name for a given sequence of Unicode characters.- Parameters:
unicodeSequence- sequence of Unicode characters- Returns:
- PostScript glyph name, or ".notdef"
-
toUnicode
public java.lang.String toUnicode(java.lang.String name)
Returns the Unicode character sequence for the given glyph name, or null if there isn't any.- Parameters:
name- PostScript glyph name- Returns:
- Unicode character(s), or null.
-
-