fop 0.95

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

java.lang.Object
  extended by org.apache.fop.fonts.Typeface
      extended by org.apache.fop.render.afp.fonts.AFPFont
          extended by org.apache.fop.render.afp.fonts.RasterFont
All Implemented Interfaces:
FontMetrics

public class RasterFont
extends AFPFont

A font where each character is stored as an array of pixels (a bitmap). Such fonts are not easily scalable, in contrast to vectored fonts. With this type of font, the font metrics information is held in character set files (one for each size and style).


Field Summary
protected static org.apache.commons.logging.Log log
          Static logging instance
 
Fields inherited from class org.apache.fop.render.afp.fonts.AFPFont
name
 
Constructor Summary
RasterFont(java.lang.String name)
          Constructor for the raster font requires the name, weight and style attribute to be available as this forms the key to the font.
 
Method Summary
 void addCharacterSet(int size, CharacterSet characterSet)
          Adds the character set for the given point size
 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(int size)
          Get the character set metrics for the specified point size.
 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".
 java.lang.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
getEmbedFontName, getFamilyNames, getFontName, getFontType, getFullName, getKerningInfo, hasChar, hasKerningInfo
 
Methods inherited from class org.apache.fop.fonts.Typeface
getMaxAscent, hadMappingOperations, isMultiByte, notifyMapOperation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
Static logging instance

Constructor Detail

RasterFont

public RasterFont(java.lang.String name)
Constructor for the raster font requires the name, weight and style attribute to be available as this forms the key to the font.

Parameters:
name - the name of the font
Method Detail

addCharacterSet

public void addCharacterSet(int size,
                            CharacterSet characterSet)
Adds the character set for the given point size

Parameters:
size - point size
characterSet - character set

getCharacterSet

public CharacterSet getCharacterSet(int size)
Get the character set metrics for the specified point size.

Specified by:
getCharacterSet in class AFPFont
Parameters:
size - the point size
Returns:
the character set metrics

getFirstChar

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

Returns:
the first character in this font.

getLastChar

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

Returns:
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
Returns:
the ascender for the given point size

getCapHeight

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

Parameters:
size - the point size
Returns:
the cap height for the specified 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
Returns:
the descender for the specified point size

getXHeight

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

Parameters:
size - the point size
Returns:
the x height for the given point size

getWidth

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

Parameters:
character - the character
size - the point size
Returns:
the width for the given point size

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

getWidths

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

Returns:
the widths of all characters

mapChar

public char mapChar(char c)
Map a Unicode character to a code point in the font.

Specified by:
mapChar in class Typeface
Parameters:
c - character to map
Returns:
the mapped character

getEncoding

public java.lang.String getEncoding()
Get the encoding of the font.

Specified by:
getEncoding in class Typeface
Returns:
the encoding

fop 0.95

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