fop 0.95

org.apache.fop.fonts
Class SingleByteFont

java.lang.Object
  extended by org.apache.fop.fonts.Typeface
      extended by org.apache.fop.fonts.CustomFont
          extended by org.apache.fop.fonts.SingleByteFont
All 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.
 java.lang.String getEncoding()
          Get the encoding of the font.
 int getWidth(int i, int size)
          Return the width (in 1/1000ths of point size) of the character at code point i.
 int[] getWidths()
          Return the array of widths.
 boolean hasChar(char c)
          Determines whether this font contains a particular character/glyph.
 boolean isEmbeddable()
          Indicates if this font may be embedded.
 char mapChar(char c)
          Map a Unicode character to a code point in the font.
 void setEncoding(CodePointMapping encoding)
          Sets the encoding of the font.
 void setEncoding(java.lang.String encoding)
          Sets the encoding of the font.
 void setWidth(int index, int width)
          Sets a width for a character.
protected  void updateMapping(java.lang.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, isSymbolicFont, 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
getMaxAscent, hadMappingOperations, isMultiByte, notifyMapOperation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.fop.fonts.FontMetrics
getMaxAscent
 

Constructor Detail

SingleByteFont

public SingleByteFont()
Main constructor.

Method Detail

isEmbeddable

public boolean isEmbeddable()
Indicates if this font may be embedded.

Returns:
True, if embedding is possible/permitted

getEncoding

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

Specified by:
getEncoding in class Typeface
Returns:
the encoding

getCodePointMapping

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

Returns:
the code point mapping

getWidth

public int getWidth(int i,
                    int size)
Return the width (in 1/1000ths of point size) of the character at code point i.

Parameters:
i - code point index
size - font size
Returns:
the width of the character

getWidths

public int[] getWidths()
Return the array of widths.

This is used to get an array for inserting in an output format. It should not be used for lookup.

Returns:
an array of widths

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

hasChar

public boolean hasChar(char c)
Determines whether this font contains a particular character/glyph.

Specified by:
hasChar in class Typeface
Parameters:
c - character to check
Returns:
True if the character is supported, Falso otherwise

updateMapping

protected void updateMapping(java.lang.String encoding)
Updates the mapping variable based on the encoding.

Parameters:
encoding - the name of the encoding

setEncoding

public void setEncoding(java.lang.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

fop 0.95

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