com.openpcl.pclrenderimage.softfont
Class PriFontBase

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

public abstract class PriFontBase
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
static int AGFA_FONT
          Intellifont Scalable font/typeface
static int BITMAP_FONT
          Bitmap font
protected  int cellHeight
          For bitmap fonts this is cell width.
protected  int cellWidth
          For bitmap fonts this is cell height.
protected  int[] characterComplement
          For unbound font's character complement is use to check if a font can display desired symbol collection
protected  boolean isFixedPitch
           
protected  boolean isPermanent
          This is applicapable for soft fonts only ( location == RAM ) true this font is permanent false this font is temporary For more information about temporary and permanent soft fonts refer to PCL Techincal Reference Soft Fonts
protected  String name
          Name of the font.
protected  int orientation
          Orientation characteristic.
protected  double pitch
           
protected  boolean spaceDisplayable
          Indicates whteher space character is displayable.
protected  int storage
          One of storage constants.
static int STORAGE_CARTRIDGE0
           
static int STORAGE_CARTRIDGE1
           
static int STORAGE_INTERNAL
          A printer comes with a standard set of internal fonts.
static int STORAGE_RAM
           
static int STORAGE_SIMM
           
protected  int strokeWeight
           
protected  int style
           
protected  int symbolset
          Font's symbolset.
static int TRUETYPE_FONT
          TrueType scalable font/typeface
protected  int typefaceFamily
           
 
Constructor Summary
protected PriFontBase()
           
protected PriFontBase(int symbolset, int[] characterComplement, int typefaceFamily, double pitch, int cellWidth, int cellHeight, int storage)
          Initliaze font characteristics
protected PriFontBase(int symbolset, int[] characterComplement, int typefaceFamily, int pitch, int cellWidth, int cellHeight)
           
 
Method Summary
abstract  boolean canDisplay(char charCode)
           
 boolean canDisplaySpace()
           
 void dump()
           
 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.
 int getCellHeight()
           
 int getCellWidth()
           
 int[] getCharacterComplement()
           
abstract  float getHeight()
           
 String getName()
           
 int getOrientation()
           
 double getPitch()
           
 int getStorage()
           
 int getStrokeWeight()
           
 int getStyle()
           
 int getSymbolset()
           
 int getTypefaceFamily()
           
 boolean isFixedPitch()
           
 boolean isPermanent()
           
 boolean isUnbound()
           
 void setPermanent(boolean isPermanent)
           
 void setStorage(int storage)
           
 String toString()
           
abstract  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 java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUETYPE_FONT

public static final int TRUETYPE_FONT
TrueType scalable font/typeface

See Also:
Constant Field Values

BITMAP_FONT

public static final int BITMAP_FONT
Bitmap font

See Also:
Constant Field Values

AGFA_FONT

public static final int AGFA_FONT
Intellifont Scalable font/typeface

See Also:
Constant Field Values

STORAGE_INTERNAL

public static final int STORAGE_INTERNAL
A printer comes with a standard set of internal fonts. The user can install additional fonts using cartridge or simms. Additional fonts can be downloaded to the printer during a print job. The location is a consideration when selecting a font.

See Also:
Constant Field Values

STORAGE_CARTRIDGE0

public static final int STORAGE_CARTRIDGE0
See Also:
Constant Field Values

STORAGE_CARTRIDGE1

public static final int STORAGE_CARTRIDGE1
See Also:
Constant Field Values

STORAGE_SIMM

public static final int STORAGE_SIMM
See Also:
Constant Field Values

STORAGE_RAM

public static final int STORAGE_RAM
See Also:
Constant Field Values

symbolset

protected int symbolset
Font's symbolset. If this ia a bound font then then this field is set to symbolset's code else it is 0, and character complement number is used.


characterComplement

protected int[] characterComplement
For unbound font's character complement is use to check if a font can display desired symbol collection


typefaceFamily

protected int typefaceFamily

pitch

protected double pitch

style

protected int style

strokeWeight

protected int strokeWeight

cellHeight

protected int cellHeight
For bitmap fonts this is cell width. For truetype fonts it is units per em value


cellWidth

protected int cellWidth
For bitmap fonts this is cell height. For truetype fonts it is units per em value


isFixedPitch

protected boolean isFixedPitch

orientation

protected int orientation
Orientation characteristic. As we can rotate fonts this characteristics is not realley neaded


name

protected String name
Name of the font. This name is not used during font selection. ...


storage

protected int storage
One of storage constants. Specifies font's location


isPermanent

protected boolean isPermanent
This is applicapable for soft fonts only ( location == RAM ) true this font is permanent false this font is temporary For more information about temporary and permanent soft fonts refer to PCL Techincal Reference Soft Fonts


spaceDisplayable

protected boolean spaceDisplayable
Indicates whteher space character is displayable. As space character is widely used so we treat it a little bit different. This value is initialized at the the time the font is loaded.

Constructor Detail

PriFontBase

protected PriFontBase()

PriFontBase

protected PriFontBase(int symbolset,
                      int[] characterComplement,
                      int typefaceFamily,
                      double pitch,
                      int cellWidth,
                      int cellHeight,
                      int storage)
Initliaze font characteristics

Parameters:
symbolset - symbolset code or 0 for unbound font
characterComplement - an array of 8 numbers wchich defines symbol collections supported by a font or null for a bound font
typefaceFamily - typefaceFamily characteristic
pitch -
cellWidth -
cellHeight -
storage -

PriFontBase

protected PriFontBase(int symbolset,
                      int[] characterComplement,
                      int typefaceFamily,
                      int pitch,
                      int cellWidth,
                      int cellHeight)
Method Detail

type

public abstract 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


getName

public String getName()

isUnbound

public boolean isUnbound()

isFixedPitch

public boolean isFixedPitch()

getSymbolset

public int getSymbolset()

getCharacterComplement

public int[] getCharacterComplement()

getTypefaceFamily

public int getTypefaceFamily()

getPitch

public double getPitch()

getStorage

public int getStorage()

setStorage

public void setStorage(int storage)

getStyle

public int getStyle()

getStrokeWeight

public int getStrokeWeight()

getCellHeight

public int getCellHeight()

getCellWidth

public int getCellWidth()

getOrientation

public int getOrientation()
Returns:
orientation The value is -1 if the font is available in all directions

isPermanent

public boolean isPermanent()

setPermanent

public void setPermanent(boolean isPermanent)

canDisplaySpace

public boolean canDisplaySpace()

canDisplay

public abstract boolean canDisplay(char charCode)

getHeight

public abstract float getHeight()

equals

public 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. they have same charactericts ( Symbol set, Spacing, Pitch,... )

Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

dump

public void dump()


OpenPCL http://www.openpcl.com