Class Encoding
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.font.encoding.Encoding
-
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
BuiltInEncoding,DictionaryEncoding,MacRomanEncoding,StandardEncoding,Type1Encoding,WinAnsiEncoding
public abstract class Encoding extends Object implements COSObjectable
A PostScript encoding vector, maps character codes to glyph names.
-
-
Constructor Summary
Constructors Constructor Description Encoding()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadd(int code, String name)This will add a character encoding.booleancontains(int code)Determines if the encoding has a mapping for the given code value.booleancontains(String name)Determines if the encoding has a mapping for the given name value.Map<Integer,String>getCodeToNameMap()Returns an unmodifiable view of the Code2Name mapping.static EncodinggetInstance(COSName name)This will get an encoding by name.StringgetName(int code)This will take a character code and get the name from the code.-
Methods inherited from interface com.tom_roush.pdfbox.pdmodel.common.COSObjectable
getCOSObject
-
-
-
-
Method Detail
-
getInstance
public static Encoding getInstance(COSName name)
This will get an encoding by name. May return null.- Parameters:
name- The name of the encoding to get.- Returns:
- The encoding that matches the name.
-
getCodeToNameMap
public Map<Integer,String> getCodeToNameMap()
Returns an unmodifiable view of the Code2Name mapping.- Returns:
- the Code2Name map
-
add
protected void add(int code, String name)This will add a character encoding.- Parameters:
code- character codename- PostScript glyph name
-
contains
public boolean contains(String name)
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
public String getName(int code)
This will take a character code and get the name from the code.- Parameters:
code- character code- Returns:
- PostScript glyph name
-
-