Package org.apache.fontbox.encoding
Class Encoding
java.lang.Object
org.apache.fontbox.encoding.Encoding
- Direct Known Subclasses:
MacRomanEncoding
This is an interface to a text encoder.
- Version:
- $Revision: 1.1 $
- Author:
- Ben Litchfield
-
Field Summary
FieldsModifier and TypeFieldDescriptionThis is a mapping from a character code to a character name.static final String[]
The 258 standard mac glyph names a used in 'post' format 1 and 2.The indices of the standard mac glyph names.This is a mapping from a character name to a character code.static final int
The number of standard mac glyph names. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addCharacterEncoding
(int code, String name) This will add a character encoding.getCharacter
(int code) This will get the character from the code.static String
getCharacter
(String name) This will get the character from the name.int
This will get the character code for the name.getName
(int code) This will take a character code and get the name from the code.getNameFromCharacter
(char c) This will take a character code and get the name from the code.
-
Field Details
-
NUMBER_OF_MAC_GLYPHS
public static final int NUMBER_OF_MAC_GLYPHSThe number of standard mac glyph names.- See Also:
-
MAC_GLYPH_NAMES
The 258 standard mac glyph names a used in 'post' format 1 and 2. -
MAC_GLYPH_NAMES_INDICES
The indices of the standard mac glyph names. -
codeToName
This is a mapping from a character code to a character name. -
nameToCode
This is a mapping from a character name to a character code.
-
-
Constructor Details
-
Encoding
public Encoding()
-
-
Method Details
-
addCharacterEncoding
This will add a character encoding.- Parameters:
code
- The character code that matches the character.name
- The name of the character.
-
getCode
This will get the character code for the name.- Parameters:
name
- The name of the character.- Returns:
- The code for the character.
- Throws:
IOException
- If there is no character code for the name.
-
getName
This will take a character code and get the name from the code.- Parameters:
code
- The character code.- Returns:
- The name of the character.
- Throws:
IOException
- If there is no name for the code.
-
getNameFromCharacter
This will take a character code and get the name from the code.- Parameters:
c
- The character.- Returns:
- The name of the character.
- Throws:
IOException
- If there is no name for the character.
-
getCharacter
This will get the character from the code.- Parameters:
code
- The character code.- Returns:
- The printable character for the code.
- Throws:
IOException
- If there is not name for the character.
-
getCharacter
This will get the character from the name.- Parameters:
name
- The name of the character.- Returns:
- The printable character for the code.
-