public class CharacterSet
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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
|
static int |
SUPPORTED_ORIENTATION
The current orientation (currently only 0 is supported by FOP)
|
Modifier and Type | Method and Description |
---|---|
void |
addCharacterSetOrientation(CharacterSetOrientation cso)
Add character set metric information for the different orientations
|
CharactersetEncoder.EncodedChars |
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.awt.Rectangle |
getCharacterBox(char character,
int size) |
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.
|
int |
getEmSpaceIncrement()
Returns the increment for an em space.
|
java.lang.String |
getEncoding()
Returns the AFP code page encoding
|
java.lang.String |
getName()
Returns the AFP character set identifier
|
byte[] |
getNameBytes()
Returns the AFP character set identifier as a byte array
|
int |
getNominalCharIncrement()
Returns the nominal character increment.
|
int |
getNominalVerticalSize()
Returns the nominal vertical size of the font in the case of bitmap fonts.
|
AFPResourceAccessor |
getResourceAccessor()
Returns the resource accessor to load the font resources with.
|
int |
getSpaceIncrement()
Returns the increment for an space.
|
int |
getUnderscorePosition()
Return the position for an underscore (_) character.
|
int |
getUnderscoreWidth()
Return the width to use for an underscore (_) character.
|
int |
getWidth(char character,
int size)
Get the width (in 1/1000ths of a point size) of the character
identified by the parameter passed.
|
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.
|
void |
setNominalVerticalSize(int nominalVerticalSize)
Sets the nominal vertical size of the font in the case of bitmap fonts.
|
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
public static final int SUPPORTED_ORIENTATION
protected final java.lang.String codePage
protected final java.lang.String encoding
protected final java.lang.String name
public void addCharacterSetOrientation(CharacterSetOrientation cso)
cso
- the metrics for the orientationpublic void setNominalVerticalSize(int nominalVerticalSize)
nominalVerticalSize
- the nominal vertical size (in millipoints)public int getNominalVerticalSize()
public int getAscender()
public int getUnderscoreWidth()
public int getUnderscorePosition()
public int getCapHeight()
public int getDescender()
public AFPResourceAccessor getResourceAccessor()
public int getXHeight()
public int getWidth(char character, int size)
character
- the Unicode character from which the width will be calculatedsize
- the font sizepublic java.awt.Rectangle getCharacterBox(char character, int size)
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 checkpublic CharactersetEncoder.EncodedChars encodeChars(java.lang.CharSequence chars) throws java.nio.charset.CharacterCodingException
chars
- the charactersjava.nio.charset.CharacterCodingException
- if the encoding operation failspublic char mapChar(char c)
c
- the Unicode character to mappublic int getSpaceIncrement()
public int getEmSpaceIncrement()
public int getNominalCharIncrement()
Copyright 1999-2017 The Apache Software Foundation. All Rights Reserved.