org.apache.fop.fonts

Class SingleByteFont

Implemented Interfaces:
FontDescriptor, FontMetrics, MutableFont

public class SingleByteFont
extends CustomFont

Generic SingleByte font

Constructor Summary

SingleByteFont()
Main constructor.

Method Summary

CodePointMapping
getCodePointMapping()
Returns the code point mapping (encoding) of this font.
String
getEncoding()
int
getWidth(int i, int size)
int[]
getWidths()
boolean
hasChar(char c)
boolean
isEmbeddable()
char
mapChar(char c)
void
setEncoding(String encoding)
Sets the encoding of the font.
void
setEncoding(CodePointMapping encoding)
Sets the encoding of the font.
void
setWidth(int index, int width)
Sets a width for a character.
protected void
updateMapping(String encoding)
Updates the mapping variable based on the encoding.

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

getAscender, getAscender, getCapHeight, getCapHeight, getDescender, getDescender, getEmbedFileName, getEmbedFileSource, getEmbedFontName, getEmbedResourceName, getFamilyNames, getFirstChar, getFlags, getFontBBox, getFontName, getFontSubName, getFontType, getFullName, getItalicAngle, getKerningInfo, getLastChar, getMissingWidth, getStemV, getStrippedFontName, getWeight, getXHeight, hasKerningInfo, isKerningEnabled, putKerningEntry, replaceKerningMap, setAscender, setCapHeight, setDescender, setEmbedFileName, setEmbedResourceName, setFamilyNames, setFirstChar, setFlags, setFontBBox, setFontName, setFontSubFamilyName, setFontType, setFullName, setItalicAngle, setKerningEnabled, setLastChar, setMissingWidth, setResolver, setStemV, setWeight, setXHeight

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

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

Constructor Details

SingleByteFont

public SingleByteFont()
Main constructor.

Method Details

getCodePointMapping

public CodePointMapping getCodePointMapping()
Returns the code point mapping (encoding) of this font.
Returns:
the code point mapping

getEncoding

public String getEncoding()
Overrides:
getEncoding 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

hasChar

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

isEmbeddable

public boolean isEmbeddable()
Specified by:
isEmbeddable in interface FontDescriptor

mapChar

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

setEncoding

public void setEncoding(String encoding)
Sets the encoding of the font.
Parameters:
encoding - the encoding (ex. "WinAnsiEncoding" or "SymbolEncoding")

setEncoding

public void setEncoding(CodePointMapping encoding)
Sets the encoding of the font.
Parameters:
encoding - the encoding information

setWidth

public void setWidth(int index,
                     int width)
Sets a width for a character.
Parameters:
index - index of the character
width - the width of the character

updateMapping

protected void updateMapping(String encoding)
Updates the mapping variable based on the encoding.
Parameters:
encoding - the name of the encoding

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