Package org.apache.fop.afp.fonts
Class FopCharacterSet
java.lang.Object
org.apache.fop.afp.fonts.CharacterSet
org.apache.fop.afp.fonts.FopCharacterSet
A Character set for a normal FOP font
-
Field Summary
Fields inherited from class org.apache.fop.afp.fonts.CharacterSet
codePage, DEFAULT_CODEPAGE, DEFAULT_ENCODING, encoding, LOG, name, SUPPORTED_ORIENTATION -
Constructor Summary
ConstructorsConstructorDescriptionFopCharacterSet(String codePage, String encoding, String name, Typeface charSet, AFPEventProducer eventProducer) Constructor for the CharacterSetMetric object, the character set is used to load the font information from the actual AFP font.FopCharacterSet(String codePage, String encoding, String name, Typeface charSet, AFPResourceAccessor accessor, AFPEventProducer eventProducer) -
Method Summary
Modifier and TypeMethodDescriptionintAscender height is the distance from the character baseline to the top of the character box.intCap height is the average height of the uppercase characters in a font.getCharacterBox(char character, int size) intDescender depth is the distance from the character baseline to the bottom of a character box.intReturn the position for an underscore (_) character.intReturn the width to use for an underscore (_) character.intgetWidth(char character, int size) Get the width (in 1/1000ths of a point size) of the character identified by the parameter passed.intXHeight refers to the height of the lower case letters above the baseline.charmapChar(char c) Map a Unicode character to a code point in the font.Methods inherited from class org.apache.fop.afp.fonts.CharacterSet
addCharacterSetOrientation, encodeChars, getCodePage, getEmSpaceIncrement, getEncoding, getName, getNameBytes, getNominalCharIncrement, getNominalVerticalSize, getResourceAccessor, getSpaceIncrement, hasChar, setNominalVerticalSize
-
Constructor Details
-
FopCharacterSet
public FopCharacterSet(String codePage, String encoding, String name, Typeface charSet, AFPEventProducer eventProducer) Constructor for the CharacterSetMetric object, the character set is used to load the font information from the actual AFP font.- Parameters:
codePage- the code page identifierencoding- the encoding of the fontname- the character set namecharSet- the fop character seteventProducer- for handling AFP related events
-
FopCharacterSet
public FopCharacterSet(String codePage, String encoding, String name, Typeface charSet, AFPResourceAccessor accessor, AFPEventProducer eventProducer)
-
-
Method Details
-
getAscender
public int getAscender()Ascender height is the distance from the character baseline to the top of the character box. A negative ascender height signifies that all of the graphic character is below the character baseline. For a character rotation other than 0, ascender height loses its meaning when the character is lying on its side or is upside down with respect to normal viewing orientation. For the general case, Ascender Height is the character's most positive y-axis value. For bounded character boxes, for a given character having an ascender, ascender height and baseline offset are equal.- Overrides:
getAscenderin classCharacterSet- Returns:
- the ascender value in millipoints
-
getCapHeight
public int getCapHeight()Cap height is the average height of the uppercase characters in a font. This value is specified by the designer of a font and is usually the height of the uppercase M.- Overrides:
getCapHeightin classCharacterSet- Returns:
- the cap height value in millipoints
-
getDescender
public int getDescender()Descender depth is the distance from the character baseline to the bottom of a character box. A negative descender depth signifies that all of the graphic character is above the character baseline.- Overrides:
getDescenderin classCharacterSet- Returns:
- the descender value in millipoints
-
getXHeight
public int getXHeight()XHeight refers to the height of the lower case letters above the baseline.- Overrides:
getXHeightin classCharacterSet- Returns:
- the typical height of characters
-
getWidth
public int getWidth(char character, int size) Description copied from class:CharacterSetGet the width (in 1/1000ths of a point size) of the character identified by the parameter passed.- Overrides:
getWidthin classCharacterSet- Parameters:
character- the Unicode character from which the width will be calculatedsize- the font size- Returns:
- the width of the character
-
getCharacterBox
- Overrides:
getCharacterBoxin classCharacterSet
-
getUnderscoreWidth
public int getUnderscoreWidth()Description copied from class:CharacterSetReturn the width to use for an underscore (_) character.- Overrides:
getUnderscoreWidthin classCharacterSet- Returns:
- the width of an underscore character
-
getUnderscorePosition
public int getUnderscorePosition()Description copied from class:CharacterSetReturn the position for an underscore (_) character.- Overrides:
getUnderscorePositionin classCharacterSet- Returns:
- the position of an underscore character
-
mapChar
public char mapChar(char c) Map a Unicode character to a code point in the font.- Overrides:
mapCharin classCharacterSet- Parameters:
c- character to map- Returns:
- the mapped character
-