org.apache.fop.render.java2d

Class SystemFontMetricsMapper

Implemented Interfaces:
FontMetrics, FontMetricsMapper

public class SystemFontMetricsMapper
extends Typeface
implements FontMetricsMapper

This class implements org.apache.fop.layout.FontMetrics and is added to the hash table in FontInfo. It deferes the actual calculation of the metrics to Java2DFontMetrics. It only keeps the java name and style as member varibles

Constructor Summary

SystemFontMetricsMapper(String family, int style, Graphics2D graphics)
Constructs a new Font-metrics.

Method Summary

int
getAscender(int size)
int
getCapHeight(int size)
int
getDescender(int size)
String
getEmbedFontName()
String
getEncoding()
Set
getFamilyNames()
java.awt.Font
getFont(int size)
String
getFontName()
FontType
getFontType()
String
getFullName()
Map
getKerningInfo()
int
getMaxAscent(int size)
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

SystemFontMetricsMapper

public SystemFontMetricsMapper(String family,
                               int style,
                               Graphics2D graphics)
Constructs a new Font-metrics.
Parameters:
family - the family name of the font (java value)
style - the java type style value of the font
graphics - a Graphics2D object - this is needed so that we can get an instance of java.awt.FontMetrics

Method Details

getAscender

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

getCapHeight

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

getDescender

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

getEmbedFontName

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

getEncoding

public String getEncoding()
Overrides:
getEncoding in interface Typeface

getFamilyNames

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

getFont

public java.awt.Font getFont(int size)
Specified by:
getFont in interface FontMetricsMapper

getFontName

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

getFontType

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

getFullName

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

getKerningInfo

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

getMaxAscent

public int getMaxAscent(int size)
Specified by:
getMaxAscent in interface FontMetrics
Overrides:
getMaxAscent in interface Typeface

getWidth

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

getWidths

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

getXHeight

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

hasChar

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

hasKerningInfo

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

mapChar

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

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