Class GlyphList

java.lang.Object
org.apache.pdfbox.pdmodel.font.encoding.GlyphList

public final class GlyphList extends Object
PostScript glyph list, maps glyph names to sequences of Unicode characters. Instances of GlyphList are immutable.
  • Field Details

    • 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 Map<String,String> nameToUnicode
    • unicodeToName

      private final Map<String,String> unicodeToName
    • uniNameToUnicodeCache

      private final Map<String,String> uniNameToUnicodeCache
  • Constructor Details

    • GlyphList

      public GlyphList(InputStream input, int numberOfEntries) throws IOException
      Creates a new GlyphList from a glyph list file.
      Parameters:
      numberOfEntries - number of expected values used to preallocate the correct amount of memory
      input - glyph list in Adobe format
      Throws:
      IOException - if the glyph list could not be read
    • GlyphList

      public GlyphList(GlyphList glyphList, InputStream input) throws IOException
      Creates a new GlyphList from multiple glyph list files.
      Parameters:
      glyphList - an existing glyph list to be copied
      input - glyph list in Adobe format
      Throws:
      IOException - if the glyph list could not be read
  • Method Details

    • load

      private static GlyphList load(String filename, int numberOfEntries)
      Loads a glyph list from disk.
    • getAdobeGlyphList

      public static GlyphList getAdobeGlyphList()
      Returns the Adobe Glyph List (AGL).
    • getZapfDingbats

      public static GlyphList getZapfDingbats()
      Returns the Zapf Dingbats glyph list.
    • loadList

      private void loadList(InputStream input) throws IOException
      Throws:
      IOException
    • codePointToName

      public 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 String sequenceToName(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 String toUnicode(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.