Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.font.encoding

public final Class GlyphList

extends Object
Class Inheritance
Imports
java.io.BufferedReader, .InputStream, .InputStreamReader, .IOException, org.apache.commons.logging.Log, .LogFactory, java.nio.charset.StandardCharsets, java.util.HashMap, .Map, java.util.concurrent.ConcurrentHashMap

PostScript glyph list, maps glyph names to sequences of Unicode characters. Instances of GlyphList are immutable.

Field Summary

Modifier and TypeField and Description
private static final GlyphList
private static final Log
private final Map<String, String>
private final Map<String, String>
private final Map<String, String>
private static final GlyphList

Constructor Summary

AccessConstructor and Description
public
GlyphList(InputStream
glyph list in Adobe format
input
,
int
number of expected values used to preallocate the correct amount of memory
numberOfEntries
)

Creates a new GlyphList from a glyph list file.

public
GlyphList(GlyphList
an existing glyph list to be copied
glyphList
,
InputStream
glyph list in Adobe format
input
)

Creates a new GlyphList from multiple glyph list files.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

PostScript glyph name, or ".notdef"
codePointToName
(int
Unicode code point
codePoint
)

Returns the name for the given Unicode code point.

public static GlyphList

Returns:

the Adobe glyph list
getAdobeGlyphList
()

Returns the Adobe Glyph List (AGL).

public static GlyphList

Returns:

the Zapf Dingbats glyph list
getZapfDingbats
()

Returns the Zapf Dingbats glyph list.

private static GlyphList
load(String filename, int numberOfEntries)

Loads a glyph list from disk.

private void
public String

Returns:

PostScript glyph name, or ".notdef"
sequenceToName
(String
sequence of Unicode characters
unicodeSequence
)

Returns the name for a given sequence of Unicode characters.

public String

Returns:

Unicode character(s), or null.
toUnicode
(String
PostScript glyph name
name
)

Returns the Unicode character sequence for the given glyph name, or null if there isn't any.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULTback to summary
private static final GlyphList DEFAULT
LOGback to summary
private static final Log LOG
nameToUnicodeback to summary
private final Map<String, String> nameToUnicode
unicodeToNameback to summary
private final Map<String, String> unicodeToName
uniNameToUnicodeCacheback to summary
private final Map<String, String> uniNameToUnicodeCache
ZAPF_DINGBATSback to summary
private static final GlyphList ZAPF_DINGBATS

Constructor Detail

GlyphListback to summary
public GlyphList(InputStream input, int numberOfEntries) throws IOException

Creates a new GlyphList from a glyph list file.

Parameters
input:InputStream

glyph list in Adobe format

numberOfEntries:int

number of expected values used to preallocate the correct amount of memory

Exceptions
IOException:
if the glyph list could not be read
GlyphListback to summary
public GlyphList(GlyphList glyphList, InputStream input) throws IOException

Creates a new GlyphList from multiple glyph list files.

Parameters
glyphList:GlyphList

an existing glyph list to be copied

input:InputStream

glyph list in Adobe format

Exceptions
IOException:
if the glyph list could not be read

Method Detail

codePointToNameback to summary
public String codePointToName(int codePoint)

Returns the name for the given Unicode code point.

Parameters
codePoint:int

Unicode code point

Returns:String

PostScript glyph name, or ".notdef"

getAdobeGlyphListback to summary
public static GlyphList getAdobeGlyphList()

Returns the Adobe Glyph List (AGL).

Returns:GlyphList

the Adobe glyph list

getZapfDingbatsback to summary
public static GlyphList getZapfDingbats()

Returns the Zapf Dingbats glyph list.

Returns:GlyphList

the Zapf Dingbats glyph list

loadback to summary
private static GlyphList load(String filename, int numberOfEntries)

Loads a glyph list from disk.

loadListback to summary
private void loadList(InputStream input) throws IOException
sequenceToNameback to summary
public String sequenceToName(String unicodeSequence)

Returns the name for a given sequence of Unicode characters.

Parameters
unicodeSequence:String

sequence of Unicode characters

Returns:String

PostScript glyph name, or ".notdef"

toUnicodeback to summary
public String toUnicode(String name)

Returns the Unicode character sequence for the given glyph name, or null if there isn't any.

Parameters
name:String

PostScript glyph name

Returns:String

Unicode character(s), or null.