org.apache.fop.render.java2d

Class CustomFontMetricsMapper

Implemented Interfaces:
FontMetrics, FontMetricsMapper

public class CustomFontMetricsMapper
extends Typeface
implements FontMetricsMapper

FontMetricsMapper that delegates most methods to an underlying FontMetrics instance. This class was designed to allow the underlying java.awt.Font to be loaded from a user-configured file not registered in the current graphics environment.

Constructor Summary

CustomFontMetricsMapper(CustomFont fontMetrics)
Construction of this class results in the immediate construction.
CustomFontMetricsMapper(LazyFont fontMetrics, Source fontSource)
Construction of this class results in the immediate construction of the underlying java.awt.Font

Method Summary

int
getAscender(int size)
int
getCapHeight(int size)
int
getDescender(int size)
String
getEmbedFontName()
String
getEncoding()
Set
getFamilyNames()
Font
getFont(int size)
String
getFontName()
FontType
getFontType()
String
getFullName()
Map
getKerningInfo()
int
getWidth(int i, int size)
int[]
getWidths()
int
getXHeight(int size)
boolean
hasChar(char c)
boolean
hasKerningInfo()
char
mapChar(char c)

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

getEncoding, getMaxAscent, hadMappingOperations, hasChar, isMultiByte, mapChar, notifyMapOperation

Constructor Details

CustomFontMetricsMapper

public CustomFontMetricsMapper(CustomFont fontMetrics)
            throws FontFormatException,
                   IOException
Construction of this class results in the immediate construction. of the underlying java.awt.Font
Parameters:
fontMetrics -

CustomFontMetricsMapper

public CustomFontMetricsMapper(LazyFont fontMetrics,
                               Source fontSource)
            throws FontFormatException,
                   IOException
Construction of this class results in the immediate construction of the underlying java.awt.Font
Parameters:
fontMetrics -

Method Details

getAscender

public final int getAscender(int size)
Specified by:
getAscender in interface FontMetrics

getCapHeight

public final int getCapHeight(int size)
Specified by:
getCapHeight in interface FontMetrics

getDescender

public final int getDescender(int size)
Specified by:
getDescender in interface FontMetrics

getEmbedFontName

public final String getEmbedFontName()
Specified by:
getEmbedFontName in interface FontMetrics

getEncoding

public final String getEncoding()
Overrides:
getEncoding in interface Typeface

getFamilyNames

public final Set getFamilyNames()
Specified by:
getFamilyNames in interface FontMetrics

getFont

public final Font getFont(int size)
Specified by:
getFont in interface FontMetricsMapper

getFontName

public final String getFontName()
Specified by:
getFontName in interface FontMetrics

getFontType

public final FontType getFontType()
Specified by:
getFontType in interface FontMetrics

getFullName

public final String getFullName()
Specified by:
getFullName in interface FontMetrics

getKerningInfo

public final Map getKerningInfo()
Specified by:
getKerningInfo in interface FontMetrics

getWidth

public final int getWidth(int i,
                          int size)
Specified by:
getWidth in interface FontMetrics

getWidths

public final int[] getWidths()
Specified by:
getWidths in interface FontMetrics

getXHeight

public final int getXHeight(int size)
Specified by:
getXHeight in interface FontMetrics

hasChar

public final boolean hasChar(char c)
Overrides:
hasChar in interface Typeface

hasKerningInfo

public final boolean hasKerningInfo()
Specified by:
hasKerningInfo in interface FontMetrics

mapChar

public final char mapChar(char c)
Overrides:
mapChar in interface Typeface

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