org.apache.fop.render.afp.fonts
Class OutlineFont

java.lang.Object
  extended byorg.apache.fop.render.afp.fonts.BaseFont
      extended byorg.apache.fop.render.afp.fonts.OutlineFont
All Implemented Interfaces:
org.apache.fop.layout.FontMetric

public class OutlineFont
extends BaseFont

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.BaseFont
_name, _style, _weight
 
Constructor Summary
OutlineFont(java.lang.String name, java.lang.String weight, java.lang.String style, 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.
 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".
 int getFirstChar()
          Get the first character in this font.
 int getLastChar()
          Get the last character in this font.
 int[] getWidths(int size)
          Get the width (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").
 int width(int character, int size)
          Obtain the width of the character for the specified point size.
 
Methods inherited from class org.apache.fop.render.afp.fonts.BaseFont
getName, getStyle, getWeight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutlineFont

public OutlineFont(java.lang.String name,
                   java.lang.String weight,
                   java.lang.String style,
                   CharacterSet characterSet)
Constructor for an outline font.

Parameters:
name - the name of the font
weight - the weight of the font
style - the style of the font
characterSet - the chracter set
Method Detail

getCharacterSet

public CharacterSet getCharacterSet()
Get the character set metrics.

Returns:
the character set

getFirstChar

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


getLastChar

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


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.

Parameters:
size - the point size

getCapHeight

public int getCapHeight(int size)
Obtains the height of capital letters for the specified point size.

Parameters:
size - the point size

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.

Parameters:
size - the point size

getXHeight

public int getXHeight(int size)
The "x-height" (the height of the letter "x").

Parameters:
size - the point size

width

public int width(int character,
                 int size)
Obtain the width of the character for the specified point size.


getWidths

public int[] getWidths(int size)
Get the width (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