jxl.write
Class WritableFont

java.lang.Object
  |
  +--jxl.biff.RecordData
        |
        +--jxl.biff.WritableRecordData
              |
              +--jxl.biff.FontRecord
                    |
                    +--jxl.write.biff.WritableFontRecord
                          |
                          +--jxl.write.WritableFont
All Implemented Interfaces:
ByteData, Font
Direct Known Subclasses:
Font

public class WritableFont
extends WritableFontRecord

A class which is instantiated when the user application wishes to specify the font for a particular cell


Inner Class Summary
(package private) static class WritableFont.BoldStyle
          Static inner class used for the boldness of the fonts
static class WritableFont.FontName
          Static inner class used for classifying the font names
 
Inner classes inherited from class jxl.biff.FontRecord
FontRecord.Biff7
 
Field Summary
static WritableFont.FontName ARIAL
          Objects created with this font name will be rendered within Excel as ARIAL fonts
static WritableFont.BoldStyle BOLD
          Indicates that this font should be presented in a BOLD style
static WritableFont.FontName COURIER
          Objects created with this font name will be rendered within Excel as COURIER fonts
static int DEFAULT_POINT_SIZE
          The default point size for all Fonts
static WritableFont.BoldStyle NO_BOLD
          Indicates that this font should not be presented as bold
static WritableFont.FontName TAHOMA
          Objects created with this font name will be rendered within Excel as TAHOMA fonts
static WritableFont.FontName TIMES
          Objects created with this font name will be rendered within Excel as TIMES fonts
 
Fields inherited from class jxl.biff.FontRecord
biff7, boldWeight, characterSet, colourIndex, fontFamily, fontIndex, initialized, italic, name, pointHeight, scriptStyle, struckout, underlineStyle
 
Fields inherited from class jxl.biff.WritableRecordData
maxRecordLength
 
Fields inherited from class jxl.biff.RecordData
code, record
 
Constructor Summary
WritableFont(Font f)
          Publicly available copy constructor
WritableFont(WritableFont.FontName fn)
          Creates a default font, vanilla font of the specified face and with default point size.
WritableFont(WritableFont.FontName fn, int ps)
          Constructs of font of the specified face and of size given by the specified point size
WritableFont(WritableFont.FontName fn, int ps, WritableFont.BoldStyle bs)
          Creates a font of the specified face, point size and bold style
WritableFont(WritableFont.FontName fn, int ps, WritableFont.BoldStyle bs, boolean italic)
          Creates a font of the specified face, point size, bold weight and italicised option.
WritableFont(WritableFont.FontName fn, int ps, WritableFont.BoldStyle bs, boolean it, UnderlineStyle us)
          Creates a font of the specified face, point size, bold weight, italicisation and underline style
WritableFont(WritableFont.FontName fn, int ps, WritableFont.BoldStyle bs, boolean it, UnderlineStyle us, Colour c)
          Creates a font of the specified face, point size, bold style, italicisation, underline style and colour
WritableFont(WritableFont.FontName fn, int ps, WritableFont.BoldStyle bs, boolean it, UnderlineStyle us, Colour c, ScriptStyle ss)
          Creates a font of the specified face, point size, bold style, italicisation, underline style, colour, and script style (superscript/subscript)
 
Method Summary
static WritableFont.FontName createFont(java.lang.String fontName)
          Factory method which creates the specified font name.
 void setBoldStyle(WritableFont.BoldStyle boldStyle)
          Sets the bold style for this font, if the font hasn't been initialized
 void setColour(Colour colour)
          Sets the colour for this font, if the font hasn't been initialized
 void setItalic(boolean italic)
          Sets the italic indicator for this font, if the font hasn't been initialized
 void setPointSize(int pointSize)
          Sets the point size for this font, if the font hasn't been initialized
 void setScriptStyle(ScriptStyle scriptStyle)
          Sets the script style (eg.
 void setUnderlineStyle(UnderlineStyle us)
          Sets the underline style for this font, if the font hasn't been initialized
 
Methods inherited from class jxl.write.biff.WritableFontRecord
setBoldStyle, setColour, setScriptStyle, setStruckout, setUnderlineStyle
 
Methods inherited from class jxl.biff.FontRecord
equals, getBoldWeight, getColour, getData, getFontIndex, getName, getPointSize, getScriptStyle, getUnderlineStyle, initialize, isInitialized, isItalic, isStruckout, setFontBoldStyle, setFontColour, setFontItalic, setFontPointSize, setFontScriptStyle, setFontStruckout, setFontUnderlineStyle, uninitialize
 
Methods inherited from class jxl.biff.WritableRecordData
getBytes, handleContinueRecords
 
Methods inherited from class jxl.biff.RecordData
getCode, getRecord
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

ARIAL

public static WritableFont.FontName ARIAL
Objects created with this font name will be rendered within Excel as ARIAL fonts

TIMES

public static WritableFont.FontName TIMES
Objects created with this font name will be rendered within Excel as TIMES fonts

COURIER

public static WritableFont.FontName COURIER
Objects created with this font name will be rendered within Excel as COURIER fonts

TAHOMA

public static WritableFont.FontName TAHOMA
Objects created with this font name will be rendered within Excel as TAHOMA fonts

NO_BOLD

public static final WritableFont.BoldStyle NO_BOLD
Indicates that this font should not be presented as bold

BOLD

public static final WritableFont.BoldStyle BOLD
Indicates that this font should be presented in a BOLD style

DEFAULT_POINT_SIZE

public static final int DEFAULT_POINT_SIZE
The default point size for all Fonts
Constructor Detail

WritableFont

public WritableFont(WritableFont.FontName fn)
Creates a default font, vanilla font of the specified face and with default point size.
Parameters:
fn -  

WritableFont

public WritableFont(Font f)
Publicly available copy constructor
Parameters:
the - font to copy

WritableFont

public WritableFont(WritableFont.FontName fn,
                    int ps)
Constructs of font of the specified face and of size given by the specified point size
Parameters:
ps -  
fn -  

WritableFont

public WritableFont(WritableFont.FontName fn,
                    int ps,
                    WritableFont.BoldStyle bs)
Creates a font of the specified face, point size and bold style
Parameters:
ps -  
bs -  
fn -  

WritableFont

public WritableFont(WritableFont.FontName fn,
                    int ps,
                    WritableFont.BoldStyle bs,
                    boolean italic)
Creates a font of the specified face, point size, bold weight and italicised option.
Parameters:
ps -  
bs -  
italic -  
fn -  

WritableFont

public WritableFont(WritableFont.FontName fn,
                    int ps,
                    WritableFont.BoldStyle bs,
                    boolean it,
                    UnderlineStyle us)
Creates a font of the specified face, point size, bold weight, italicisation and underline style
Parameters:
ps -  
bs -  
us -  
fn -  
it -  

WritableFont

public WritableFont(WritableFont.FontName fn,
                    int ps,
                    WritableFont.BoldStyle bs,
                    boolean it,
                    UnderlineStyle us,
                    Colour c)
Creates a font of the specified face, point size, bold style, italicisation, underline style and colour
Parameters:
ps -  
bs -  
us -  
fn -  
it -  
c -  

WritableFont

public WritableFont(WritableFont.FontName fn,
                    int ps,
                    WritableFont.BoldStyle bs,
                    boolean it,
                    UnderlineStyle us,
                    Colour c,
                    ScriptStyle ss)
Creates a font of the specified face, point size, bold style, italicisation, underline style, colour, and script style (superscript/subscript)
Parameters:
ps -  
bs -  
us -  
fn -  
it -  
c -  
ss -  
Method Detail

setPointSize

public void setPointSize(int pointSize)
                  throws WriteException
Sets the point size for this font, if the font hasn't been initialized
Overrides:
setPointSize in class WritableFontRecord
Parameters:
pointSize - the point size
Throws:
WriteException, - if this font is already in use elsewhere

setBoldStyle

public void setBoldStyle(WritableFont.BoldStyle boldStyle)
                  throws WriteException
Sets the bold style for this font, if the font hasn't been initialized
Parameters:
boldStyle - the bold style
Throws:
WriteException, - if this font is already in use elsewhere

setItalic

public void setItalic(boolean italic)
               throws WriteException
Sets the italic indicator for this font, if the font hasn't been initialized
Overrides:
setItalic in class WritableFontRecord
Parameters:
italic - the italic flag
Throws:
WriteException, - if this font is already in use elsewhere

setUnderlineStyle

public void setUnderlineStyle(UnderlineStyle us)
                       throws WriteException
Sets the underline style for this font, if the font hasn't been initialized
Parameters:
us - the underline style
Throws:
WriteException, - if this font is already in use elsewhere

setColour

public void setColour(Colour colour)
               throws WriteException
Sets the colour for this font, if the font hasn't been initialized
Parameters:
colour - the colour
Throws:
WriteException, - if this font is already in use elsewhere

setScriptStyle

public void setScriptStyle(ScriptStyle scriptStyle)
                    throws WriteException
Sets the script style (eg. superscript, subscript) for this font, if the font hasn't been initialized
Parameters:
scriptStyle - the colour
Throws:
WriteException, - if this font is already in use elsewhere

createFont

public static WritableFont.FontName createFont(java.lang.String fontName)
Factory method which creates the specified font name. This method should be used with care, since the string used to create the font name must be recognized by Excel's internal processing
Parameters:
fontName - the name of the Excel font
Returns:
the font name