org.apache.fop.render.afp.fonts

Class OutlineFont

Implemented Interfaces:
FontMetrics

public class OutlineFont
extends AFPFont

A font defined as a set of lines and curves as opposed to a bitmap font. An outline font can be scaled to any size and otherwise transformed more easily than a bitmap font, and with more attractive results.

Field Summary

Fields inherited from class org.apache.fop.render.afp.fonts.AFPFont

_name

Constructor Summary

OutlineFont(String name, CharacterSet characterSet)
Constructor for an outline font.

Method Summary

int
getAscender(int size)
The ascender is the part of a lowercase letter that extends above the "x-height" (the height of the letter "x"), such as "d", "t", or "h".
int
getCapHeight(int size)
Obtains the height of capital letters for the specified point size.
CharacterSet
getCharacterSet()
Get the character set metrics.
CharacterSet
getCharacterSet(int size)
Get the character set metrics.
int
getDescender(int size)
The descender is the part of a lowercase letter that extends below the base line, such as "g", "j", or "p".
String
getEncoding()
Get the encoding of the font.
int
getFirstChar()
Get the first character in this font.
int
getLastChar()
Get the last character in this font.
int
getWidth(int character, int size)
Obtain the width of the character for the specified point size.
int[]
getWidths()
Get the getWidth (in 1/1000ths of a point size) of all characters in this character set.
int[]
getWidths(int size)
Get the getWidth (in 1/1000ths of a point size) of all characters in this character set.
int
getXHeight(int size)
The "x-height" (the height of the letter "x").
char
mapChar(char c)
Map a Unicode character to a code point in the font.

Methods inherited from class org.apache.fop.render.afp.fonts.AFPFont

getCharacterSet, getFontName, getFontType, getKerningInfo, hasChar, hasKerningInfo

Methods inherited from class org.apache.fop.fonts.Typeface

getEncoding, getMaxAscent, hasChar, isMultiByte, mapChar

Constructor Details

OutlineFont

public OutlineFont(String name,
                   CharacterSet characterSet)
Constructor for an outline font.
Parameters:
name - the name of the font
characterSet - the chracter set

Method Details

getAscender

public int getAscender(int size)
The ascender is the part of a lowercase letter that extends above the "x-height" (the height of the letter "x"), such as "d", "t", or "h". Also used to denote the part of the letter extending above the x-height.
Specified by:
getAscender in interface FontMetrics
Parameters:
size - the point size

getCapHeight

public int getCapHeight(int size)
Obtains the height of capital letters for the specified point size.
Specified by:
getCapHeight in interface FontMetrics
Parameters:
size - the point size

getCharacterSet

public CharacterSet getCharacterSet()
Get the character set metrics.
Returns:
the character set

getCharacterSet

public CharacterSet getCharacterSet(int size)
Get the character set metrics.
Overrides:
getCharacterSet in interface AFPFont
Parameters:
size - ignored
Returns:
the character set

getDescender

public int getDescender(int size)
The descender is the part of a lowercase letter that extends below the base line, such as "g", "j", or "p". Also used to denote the part of the letter extending below the base line.
Specified by:
getDescender in interface FontMetrics
Parameters:
size - the point size

getEncoding

public String getEncoding()
Get the encoding of the font.
Overrides:
getEncoding in interface Typeface
Returns:
the encoding

getFirstChar

public int getFirstChar()
Get the first character in this font.

getLastChar

public int getLastChar()
Get the last character in this font.

getWidth

public int getWidth(int character,
                    int size)
Obtain the width of the character for the specified point size.
Specified by:
getWidth in interface FontMetrics

getWidths

public int[] getWidths()
Get the getWidth (in 1/1000ths of a point size) of all characters in this character set.
Specified by:
getWidths in interface FontMetrics
Returns:
the widths of all characters

getWidths

public int[] getWidths(int size)
Get the getWidth (in 1/1000ths of a point size) of all characters in this character set.
Parameters:
size - the point size
Returns:
the widths of all characters

getXHeight

public int getXHeight(int size)
The "x-height" (the height of the letter "x").
Specified by:
getXHeight in interface FontMetrics
Parameters:
size - the point size

mapChar

public char mapChar(char c)
Map a Unicode character to a code point in the font.
Overrides:
mapChar in interface Typeface
Parameters:
c - character to map
Returns:
the mapped character

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.