fop 0.94

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
 char[] getCharsUsed()
           
 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(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()
          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, getEmbedResourceName, getFirstChar, getFlags, getFontBBox, getFontName, getFontSubName, getFontType, getItalicAngle, getKerningInfo, getLastChar, getMissingWidth, getStemV, getStrippedFontName, getXHeight, hasKerningInfo, isKerningEnabled, putKerningEntry, setAscender, setCapHeight, setDescender, setEmbedFileName, setEmbedResourceName, setFirstChar, setFlags, setFontBBox, setFontName, setFontSubFamilyName, setFontType, setItalicAngle, setKerningEnabled, setLastChar, setMissingWidth, setResolver, setStemV, setXHeight
 
Methods inherited from class org.apache.fop.fonts.Typeface
getMaxAscent, isMultiByte
 
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

updateMapping

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


isEmbeddable

public boolean isEmbeddable()
Description copied from interface: FontDescriptor
Indicates if this font may be embedded.

Returns:
True, if embedding is possible/permitted
See Also:
FontDescriptor.isEmbeddable()

getEncoding

public java.lang.String getEncoding()
Description copied from class: Typeface
Get the encoding of the font.

Specified by:
getEncoding in class Typeface
Returns:
the encoding
See Also:
Typeface.getEncoding()

setEncoding

public void setEncoding(java.lang.String encoding)
Sets the encoding of the font.

Parameters:
encoding - the encoding (ex. "WinAnsiEncoding" or "SymbolEncoding")

getWidth

public int getWidth(int i,
                    int size)
Description copied from interface: FontMetrics
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
See Also:
FontMetrics.getWidth(int, int)

getWidths

public int[] getWidths()
Description copied from interface: FontMetrics
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
See Also:
FontMetrics.getWidths()

mapChar

public char mapChar(char c)
Description copied from class: Typeface
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
See Also:
Typeface.mapChar(char)

hasChar

public boolean hasChar(char c)
Description copied from class: Typeface
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
See Also:
Typeface.hasChar(char)

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

getCharsUsed

public char[] getCharsUsed()

fop 0.94

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