|
fop svn-trunk | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.fop.afp.fonts.CharacterSet
public class CharacterSet
The IBM Font Object Content Architecture (FOCA) supports presentation of character shapes by defining their characteristics, which include font description information for identifying the characters, font metric information for positioning the characters, and character shape information for presenting the character images.
Presenting a graphic character on a presentation surface requires information on the rotation and position of character on the physical or logical page. This class proivdes font metric information for a particular font as identified by the character set name. This information is obtained directly from the AFP font files which must be installed in the path specified in the afp-fonts xml definition file.
| Field Summary | |
|---|---|
protected java.lang.String |
codePage
The code page to which the character set relates |
static java.lang.String |
DEFAULT_CODEPAGE
default codepage |
static java.lang.String |
DEFAULT_ENCODING
default encoding |
protected java.lang.String |
encoding
The encoding used for the code page |
protected static org.apache.commons.logging.Log |
log
Static logging instance |
protected java.lang.String |
name
The character set relating to the font |
| Constructor Summary | |
|---|---|
CharacterSet(java.lang.String codePage,
java.lang.String encoding,
java.lang.String name,
ResourceAccessor accessor)
Constructor for the CharacterSetMetric object, the character set is used to load the font information from the actual AFP font. |
|
CharacterSet(java.lang.String codePage,
java.lang.String encoding,
java.lang.String name,
java.lang.String path)
Deprecated. Please use #CharacterSet(String, String, String, URI) instead. |
|
| Method Summary | |
|---|---|
void |
addCharacterSetOrientation(CharacterSetOrientation cso)
Add character set metric information for the different orientations |
byte[] |
encodeChars(java.lang.CharSequence chars)
Encodes a character sequence to a byte array. |
int |
getAscender()
Ascender height is the distance from the character baseline to the top of the character box. |
int |
getCapHeight()
Cap height is the average height of the uppercase characters in a font. |
java.lang.String |
getCodePage()
Returns the AFP code page identifier |
int |
getDescender()
Descender depth is the distance from the character baseline to the bottom of a character box. |
java.lang.String |
getEncoding()
Returns the AFP code page encoding |
int |
getFirstChar()
Returns the first character in the character set |
int |
getLastChar()
Returns the last character in the character set |
java.lang.String |
getName()
Returns the AFP character set identifier |
byte[] |
getNameBytes()
Returns the AFP character set identifier as a byte array |
ResourceAccessor |
getResourceAccessor()
Returns the resource accessor to load the font resources with. |
int |
getWidth(int character)
Get the width (in 1/1000ths of a point size) of the character identified by the parameter passed. |
int[] |
getWidths()
Get the width (in 1/1000ths of a point size) of all characters |
int |
getXHeight()
XHeight refers to the height of the lower case letters above the baseline. |
boolean |
hasChar(char c)
Indicates whether the given char in the character set. |
char |
mapChar(char c)
Map a Unicode character to a code point in the font. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.commons.logging.Log log
public static final java.lang.String DEFAULT_CODEPAGE
public static final java.lang.String DEFAULT_ENCODING
protected java.lang.String codePage
protected java.lang.String encoding
protected java.lang.String name
| Constructor Detail |
|---|
public CharacterSet(java.lang.String codePage,
java.lang.String encoding,
java.lang.String name,
java.lang.String path)
#CharacterSet(String, String, String, URI) instead.
codePage - the code page identifierencoding - the encoding of the fontname - the character set namepath - the path to the installed afp fonts
public CharacterSet(java.lang.String codePage,
java.lang.String encoding,
java.lang.String name,
ResourceAccessor accessor)
codePage - the code page identifierencoding - the encoding of the fontname - the character set nameaccessor - the resource accessor to load resource with| Method Detail |
|---|
public void addCharacterSetOrientation(CharacterSetOrientation cso)
cso - the metrics for the orientationpublic int getAscender()
public int getCapHeight()
public int getDescender()
public int getFirstChar()
public int getLastChar()
public ResourceAccessor getResourceAccessor()
public int[] getWidths()
public int getXHeight()
public int getWidth(int character)
character - the character from which the width will be calculated
public java.lang.String getName()
public byte[] getNameBytes()
public java.lang.String getCodePage()
public java.lang.String getEncoding()
public boolean hasChar(char c)
c - the character to check
public byte[] encodeChars(java.lang.CharSequence chars)
throws java.nio.charset.CharacterCodingException
chars - the characters
java.nio.charset.CharacterCodingException - if the encoding operation failspublic char mapChar(char c)
c - character to map
|
fop svn-trunk | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||