org.fontbox.encoding
Class Encoding
java.lang.Object
org.fontbox.encoding.Encoding
public abstract class Encoding
extends java.lang.Object
This is an interface to a text encoder.
protected Map | codeToName - This is a mapping from a character code to a character name.
|
protected Map | nameToCode - This is a mapping from a character name to a character code.
|
protected void | addCharacterEncoding(int code, String name) - This will add a character encoding.
|
static String | getCharacter(String name) - This will get the character from the name.
|
String | getCharacter(int code) - This will get the character from the code.
|
int | getCode(String name) - This will get the character code for the name.
|
String | getName(int code) - This will take a character code and get the name from the code.
|
String | getNameFromCharacter(char c) - This will take a character code and get the name from the code.
|
codeToName
protected Map codeToName
This is a mapping from a character code to a character name.
nameToCode
protected Map nameToCode
This is a mapping from a character name to a character code.
addCharacterEncoding
protected void addCharacterEncoding(int code,
String name)
This will add a character encoding.
code
- The character code that matches the character.name
- The name of the character.
getCharacter
public static String getCharacter(String name)
This will get the character from the name.
name
- The name of the character.
- The printable character for the code.
getCharacter
public String getCharacter(int code)
throws IOException
This will get the character from the code.
code
- The character code.
- The printable character for the code.
getCode
public int getCode(String name)
throws IOException
This will get the character code for the name.
name
- The name of the character.
- The code for the character.
getName
public String getName(int code)
throws IOException
This will take a character code and get the name from the code.
code
- The character code.
- The name of the character.
getNameFromCharacter
public String getNameFromCharacter(char c)
throws IOException
This will take a character code and get the name from the code.
- The name of the character.