platypus
Class PlatyFont

java.lang.Object
  extended by platypus.PlatyFont

public class PlatyFont
extends java.lang.Object

PlatyFont contains font information that can be used in Platypus It's not called Font, due to naming conflict with iText.


Field Summary
private  boolean bold
          is font bold?
private  com.lowagie.text.Font font
          an iText font data item
private  boolean italic
          is font italic/slanted?
private  int lineNumber
          line number in the input file at which this font was specified
private  float size
          size of font in points
private  java.lang.String typeface
          name of typeface as used by iText
 
Constructor Summary
PlatyFont()
          set up PlatyFont.
PlatyFont(boolean pure, java.lang.String fontName, float fontSize)
          If pure, then set up a de minimus font with all ornaments turned off
PlatyFont(float fontSize)
          set up PlatyFont, using the current font but changing its size
PlatyFont(java.lang.String fontName)
          set up PlatyFont.
PlatyFont(java.lang.String fontName, float fontSize)
          set up PlatyFont using the specified font name and font size
 
Method Summary
private  void adjustStrikethru()
          when the size of a font changes, the place where the strikethru line appears should change, so that on a relative basis it crosses through the same part of each character, regardless of the height of the character.
 com.lowagie.text.Font getFont()
          return the core font element in PlatyFont
 int getLineNumber()
           
 float getSize()
           
 java.lang.String getTypeface()
           
 boolean isBold()
           
 boolean isItalic()
           
 void setBold(boolean boldOnOff)
           
 void setFont(com.lowagie.text.Font newFont)
           
 void setItalic(boolean italicOnOff)
           
 void setLineNumber(int newLineNumber)
           
 void setSize(float newSize)
           
 void setTypeface(java.lang.String newTypeface)
           
 com.lowagie.text.Font setupFont()
          Does the actual heavy lifting of setting up the new font.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

font

private com.lowagie.text.Font font
an iText font data item


lineNumber

private int lineNumber
line number in the input file at which this font was specified


bold

private boolean bold
is font bold?


italic

private boolean italic
is font italic/slanted?


typeface

private java.lang.String typeface
name of typeface as used by iText


size

private float size
size of font in points

Constructor Detail

PlatyFont

public PlatyFont()
set up PlatyFont. If no font info is specified, we default to 12p-Times Roman.


PlatyFont

public PlatyFont(java.lang.String fontName)
set up PlatyFont. If only the font name is specified, use it with the current font size, and current font attributes.

Parameters:
fontName - the specified font name/typeface

PlatyFont

public PlatyFont(float fontSize)
set up PlatyFont, using the current font but changing its size

Parameters:
fontSize - the new font size

PlatyFont

public PlatyFont(java.lang.String fontName,
                 float fontSize)
set up PlatyFont using the specified font name and font size

Parameters:
fontName - name of font to use
fontSize - size in points

PlatyFont

public PlatyFont(boolean pure,
                 java.lang.String fontName,
                 float fontSize)
If pure, then set up a de minimus font with all ornaments turned off

Parameters:
pure -
Method Detail

setupFont

public com.lowagie.text.Font setupFont()
Does the actual heavy lifting of setting up the new font. All the parameters that are needed are in the instance variables.

Returns:
the new Font object

setBold

public void setBold(boolean boldOnOff)

isBold

public boolean isBold()

setItalic

public void setItalic(boolean italicOnOff)

isItalic

public boolean isItalic()

setFont

public void setFont(com.lowagie.text.Font newFont)

getFont

public com.lowagie.text.Font getFont()
return the core font element in PlatyFont

Returns:
the font object in PlatyFont

setLineNumber

public void setLineNumber(int newLineNumber)

getLineNumber

public int getLineNumber()

getSize

public float getSize()

setSize

public void setSize(float newSize)

setTypeface

public void setTypeface(java.lang.String newTypeface)

getTypeface

public java.lang.String getTypeface()

adjustStrikethru

private void adjustStrikethru()
when the size of a font changes, the place where the strikethru line appears should change, so that on a relative basis it crosses through the same part of each character, regardless of the height of the character.



Copyright © 2006-7 Pacific Data Works LLC