|
aXSL API 0.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Encoding instances provide some standard encoding resources for PostScript. When a PostScript file is parsed, the characters in a string are really indices into an array of glyph names, which are in turn the keys to entries in a glyph dictionary. Input to a PostScript interpreter is not really characters, but rather character indexes. (The two might be the same, especially for ASCII characters).
So the PostScript interpreter uses a two-step process, as follows: 1. It conceptually maps character codes (integer values) to name objects like /A or /Uacute. This map is known as an "encoding". There are several standard encoding schemes defined in the PostScript standard that each interpreter must know how to handle. Those are provided as Encoding subclasses. 2. The name objects created in step 1 are then used as the key into a dictionary (contained in the Font dictionary) whose values contain the PostScript instructions needed to actually paint the glyph.
Field Summary | |
static char |
INVALID_UNICODE_CHAR
The invalid Unicode character, suitable as a return value in methods that need to return an invalid character. |
Method Summary | |
java.lang.String |
asPostScript(Encoding baseEncoding)
Returns this Encoding as a String in the format expected by PostScript. |
boolean |
canEncode(int codePoint)
Determine whether a given Unicode code point can be encoded by this Encoding. |
int |
decodeCharacter(int encodedIndex)
Finds the Unicode code point, if any, for a given encoding index. |
int |
encodeCharacter(int codePoint)
Finds the encoding index for a given Unicode codepoint. |
int |
getFirstIndex()
Returns the lowest glyph index used in this encoding. |
int |
getLastIndex()
Returns the highest glyph index used in this encoding. |
java.lang.String |
getName()
Return the name of this Encoding. |
boolean |
isPredefinedPDF()
Indicates whether this is a predefined PDF encoding. |
boolean |
isPredefinedPS()
Indicates whether this is a predefined PostScript encoding. |
Field Detail |
public static final char INVALID_UNICODE_CHAR
Method Detail |
public int encodeCharacter(int codePoint)
codePoint
- The Unicode codepoint which should be encoded.
public int decodeCharacter(int encodedIndex)
encodedIndex
- The encoded index which should be decoded into a
Unicode code point.
INVALID_UNICODE_CHAR
if there is none.public java.lang.String asPostScript(Encoding baseEncoding)
baseEncoding
- The encoding, if any, on which this encoding is
based.
If this encoding is similar to another encoding that will be in the same
output document, setting baseEncoding to that Encoding will allow the
return value of this method to include only the differences between the
two encodings.
Set this to null if this encoding is not based on some other encoding.
public java.lang.String getName()
public boolean isPredefinedPS()
public boolean isPredefinedPDF()
public int getFirstIndex()
public int getLastIndex()
public boolean canEncode(int codePoint)
codePoint
- The Unicode code point to be tested.
codePoint
.
|
aXSL API 0.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This documentation was created September 6 2006 by The aXSL Group and may be freely copied. See license for details.