com.openpcl.pclrenderimage.softfont
Class PriBitmapFont

java.lang.Object
  extended by com.openpcl.pclrenderimage.softfont.PriFontBase
      extended by com.openpcl.pclrenderimage.softfont.PriBitmapFont
All Implemented Interfaces:
Serializable

public class PriBitmapFont
extends PriFontBase

See Also:
Serialized Form

Field Summary
protected  float height
           
protected  Hashtable<Integer,PriBitmapCharacter> mCharacterMap
           
protected  int orientation
           
protected  int resolution
           
 
Fields inherited from class com.openpcl.pclrenderimage.softfont.PriFontBase
AGFA_FONT, BITMAP_FONT, cellHeight, cellWidth, characterComplement, isFixedPitch, isPermanent, name, pitch, spaceDisplayable, storage, STORAGE_CARTRIDGE0, STORAGE_CARTRIDGE1, STORAGE_INTERNAL, STORAGE_RAM, STORAGE_SIMM, strokeWeight, style, symbolset, TRUETYPE_FONT, typefaceFamily
 
Constructor Summary
PriBitmapFont(int symbolset, int[] characterComplement, int typefaceFamily, boolean isFixedPitch, double pitch, float height, int cellWidth, int cellHeight, int orientation, int resolution, int storage)
           
PriBitmapFont(int symbolset, int typefaceFamily, boolean isFixedPitch, double pitch, float height, int cellWidth, int cellHeight, int orientation, int resolution, int storage)
           
PriBitmapFont(PriBitmapFontHeader h)
          Creates new bitmap font (old format).
 
Method Summary
 void addChar(PriBitmapCharacter ch)
          Adds a PriBitmapCharacter to a bitmap font
 boolean canDisplay(char charCode)
           
 boolean equals(Object obj)
          true obj is FontBase instance and it's equal to this font Two fonts are equal if they could not be distinguished ie.
 PriBitmapCharacter getChar(int charCode)
          Returns PriBitmapCharacter mapped to the code
 float getHeight()
          Bitmap fonts are available only at one height as opposite to scalable fonts
 int getResolution()
          Bitmap fonts are designed either at 300dpi or 600dpi Use this method to check at what resolution is designed the font
 void removeChar(int code)
          Removes character
 int type()
          Derived classes should implement this method to return the type of the font they represent Type is either BITMAP_FONT or TRUETYPE_FONT or AGFA_FONT
 
Methods inherited from class com.openpcl.pclrenderimage.softfont.PriFontBase
canDisplaySpace, dump, getCellHeight, getCellWidth, getCharacterComplement, getName, getOrientation, getPitch, getStorage, getStrokeWeight, getStyle, getSymbolset, getTypefaceFamily, isFixedPitch, isPermanent, isUnbound, setPermanent, setStorage, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

orientation

protected int orientation

resolution

protected int resolution

height

protected float height

mCharacterMap

protected Hashtable<Integer,PriBitmapCharacter> mCharacterMap
Constructor Detail

PriBitmapFont

public PriBitmapFont(int symbolset,
                     int[] characterComplement,
                     int typefaceFamily,
                     boolean isFixedPitch,
                     double pitch,
                     float height,
                     int cellWidth,
                     int cellHeight,
                     int orientation,
                     int resolution,
                     int storage)

PriBitmapFont

public PriBitmapFont(int symbolset,
                     int typefaceFamily,
                     boolean isFixedPitch,
                     double pitch,
                     float height,
                     int cellWidth,
                     int cellHeight,
                     int orientation,
                     int resolution,
                     int storage)

PriBitmapFont

public PriBitmapFont(PriBitmapFontHeader h)
Creates new bitmap font (old format).

See PCL Technical Refence Soft font creation.

Parameters:
h - The header of the font specified during soft createation
Method Detail

type

public int type()
Description copied from class: PriFontBase
Derived classes should implement this method to return the type of the font they represent Type is either BITMAP_FONT or TRUETYPE_FONT or AGFA_FONT

Specified by:
type in class PriFontBase
Returns:
FontBase#BITMAP_FONT
See Also:
FontBase#type()

getHeight

public float getHeight()
Bitmap fonts are available only at one height as opposite to scalable fonts

Specified by:
getHeight in class PriFontBase
Returns:
height of the font

getResolution

public int getResolution()
Bitmap fonts are designed either at 300dpi or 600dpi Use this method to check at what resolution is designed the font

Returns:
resolution of the font

addChar

public void addChar(PriBitmapCharacter ch)
Adds a PriBitmapCharacter to a bitmap font

Parameters:
ch - characther to add

getChar

public PriBitmapCharacter getChar(int charCode)
Returns PriBitmapCharacter mapped to the code

Parameters:
charCode - code of required character
Returns:
PriBitmapCharacter mapped to this code or null if no mapping is available

removeChar

public void removeChar(int code)
Removes character

Parameters:
code - code of the character which have to be removed

canDisplay

public boolean canDisplay(char charCode)
Specified by:
canDisplay in class PriFontBase

equals

public boolean equals(Object obj)
Description copied from class: PriFontBase
true obj is FontBase instance and it's equal to this font Two fonts are equal if they could not be distinguished ie. they have same charactericts ( Symbol set, Spacing, Pitch,... )

Overrides:
equals in class PriFontBase
Parameters:
obj -
Returns:

true If obj is instance of Bitmap font and these two fonts are undistinguishable

false otherwise

Note Only characteristics of both fonts are compared not the characters they contain. If we have two fonts with same characteriscs but different characters this method will return true

See Also:
FontBase#equals(Object)


OpenPCL http://www.openpcl.com