Class Encoding
java.lang.Object
org.apache.pdfbox.pdmodel.font.encoding.Encoding
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
BuiltInEncoding, DictionaryEncoding, MacExpertEncoding, MacRomanEncoding, StandardEncoding, SymbolEncoding, Type1Encoding, WinAnsiEncoding, ZapfDingbatsEncoding
A PostScript encoding vector, maps character codes to glyph names.
- Author:
- Ben Litchfield
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThis will add a character encoding.booleancontains(int code) Determines if the encoding has a mapping for the given code value.booleanDetermines if the encoding has a mapping for the given name value.Returns an unmodifiable view of the code -> name mapping.abstract StringReturns the name of this encoding.static EncodinggetInstance(COSName name) This will get an encoding by name.getName(int code) This will take a character code and get the name from the code.Returns an unmodifiable view of the name -> code mapping.protected voidThis will add a character encoding.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface COSObjectable
getCOSObject
-
Field Details
-
CHAR_CODE
protected static final int CHAR_CODE- See Also:
-
CHAR_NAME
protected static final int CHAR_NAME- See Also:
-
codeToName
-
inverted
-
-
Constructor Details
-
Encoding
public Encoding()
-
-
Method Details
-
getInstance
-
getCodeToNameMap
-
getNameToCodeMap
-
add
This will add a character encoding. An already existing mapping is preserved when creating the reverse mapping. Should only be used during construction of the class.- Parameters:
code- character codename- PostScript glyph name- See Also:
-
overwrite
This will add a character encoding. An already existing mapping is overwritten when creating the reverse mapping.- Parameters:
code- character codename- PostScript glyph name- See Also:
-
contains
Determines if the encoding has a mapping for the given name value.- Parameters:
name- PostScript glyph name
-
contains
public boolean contains(int code) Determines if the encoding has a mapping for the given code value.- Parameters:
code- character code
-
getName
This will take a character code and get the name from the code.- Parameters:
code- character code- Returns:
- PostScript glyph name
-
getEncodingName
Returns the name of this encoding.
-