org.apache.fop.fonts

Class Typeface

Implemented Interfaces:
FontMetrics
Known Direct Subclasses:
AFPFont, Courier, CourierBold, CourierBoldOblique, CourierOblique, CustomFont, CustomFontMetricsMapper, Helvetica, HelveticaBold, HelveticaBoldOblique, HelveticaOblique, LazyFont, Symbol, SystemFontMetricsMapper, TimesBold, TimesBoldItalic, TimesItalic, TimesRoman, ZapfDingbats

public abstract class Typeface
extends java.lang.Object
implements FontMetrics

Base class for PDF font classes

Method Summary

abstract String
getEncoding()
Get the encoding of the font.
int
getMaxAscent(int size)
boolean
hadMappingOperations()
Indicates whether this font had to do any character mapping operations.
abstract boolean
hasChar(char c)
Determines whether this font contains a particular character/glyph.
boolean
isMultiByte()
Determines whether the font is a multibyte font.
abstract char
mapChar(char c)
Map a Unicode character to a code point in the font.
protected void
notifyMapOperation()
Used for keeping track of character mapping operations in order to determine if a font was used at all or not.

Method Details

getEncoding

public abstract String getEncoding()
Get the encoding of the font.
Returns:
the encoding

getMaxAscent

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

hadMappingOperations

public boolean hadMappingOperations()
Indicates whether this font had to do any character mapping operations. If that was not the case, it's an indication that the font has never actually been used.
Returns:
true if the font had to do any character mapping operations

hasChar

public abstract boolean hasChar(char c)
Determines whether this font contains a particular character/glyph.
Parameters:
c - character to check
Returns:
True if the character is supported, Falso otherwise

isMultiByte

public boolean isMultiByte()
Determines whether the font is a multibyte font.
Returns:
True if it is multibyte

mapChar

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

notifyMapOperation

protected void notifyMapOperation()
Used for keeping track of character mapping operations in order to determine if a font was used at all or not.

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