Top Description Methods
org.apache.poi.ss.usermodel

public Interface FontFormatting

Known Direct Implementers
org.apache.poi.hssf.usermodel.HSSFFontFormatting

High level representation for Font Formatting component of Conditional Formatting settings

Method Summary

Modifier and TypeMethod and Description
public short

Returns:

super or subscript option
getEscapementType
()

get the type of super or subscript for the font

public Color

Returns:

The colour of the font, or null if no colour applied
getFontColor
()

public short

Returns:

font colour index, or 0 if not indexed (XSSF only)
getFontColorIndex
()

public int

Returns:

fontheight (in points/20); or -1 if not modified
getFontHeight
()

gets the height of the font in 1/20th point units

public short

Returns:

font underlining type
getUnderlineType
()

get the type of underlining for the font

public boolean

Returns:

bold - whether the font is bold or not
isBold
()

get whether the font weight is set to bold or not

public boolean

Returns:

true if font style was set to italic
isItalic
()

public boolean

Returns:

true if font strikeout is on
isStruckout
()

public void
resetFontStyle()

set font style options to default values (non-italic, non-bold)

public void
setEscapementType(short
super or subscript option
escapementType
)

set the escapement type for the font

public void
setFontColor(Color
font colour to use
color
)

Sets the colour to use

public void
setFontColorIndex(short
font colour index
color
)

Sets the indexed colour to use

public void
setFontHeight(int
the height in twips (in points/20)
height
)

Sets the height of the font in 1/20th point units

public void
setFontStyle(boolean
- if true, set posture style to italic, otherwise to normal
italic
,
boolean
if true, set font weight to bold, otherwise to normal
bold
)

set font style options.

public void
setUnderlineType(short
super or subscript option
underlineType
)

set the type of underlining type for the font

Method Detail

getEscapementTypeback to summary
public short getEscapementType()

get the type of super or subscript for the font

Returns:short

super or subscript option

See Also
Font#SS_NONE, Font#SS_SUPER, Font#SS_SUB
getFontColorback to summary
public Color getFontColor()
Returns:Color

The colour of the font, or null if no colour applied

getFontColorIndexback to summary
public short getFontColorIndex()
Returns:short

font colour index, or 0 if not indexed (XSSF only)

getFontHeightback to summary
public int getFontHeight()

gets the height of the font in 1/20th point units

Returns:int

fontheight (in points/20); or -1 if not modified

getUnderlineTypeback to summary
public short getUnderlineType()

get the type of underlining for the font

Returns:short

font underlining type

See Also
Font#U_NONE, Font#U_SINGLE, Font#U_DOUBLE, Font#U_SINGLE_ACCOUNTING, Font#U_DOUBLE_ACCOUNTING
isBoldback to summary
public boolean isBold()

get whether the font weight is set to bold or not

Returns:boolean

bold - whether the font is bold or not

isItalicback to summary
public boolean isItalic()
Returns:boolean

true if font style was set to italic

isStruckoutback to summary
public boolean isStruckout()
Returns:boolean

true if font strikeout is on

resetFontStyleback to summary
public void resetFontStyle()

set font style options to default values (non-italic, non-bold)

setEscapementTypeback to summary
public void setEscapementType(short escapementType)

set the escapement type for the font

Parameters
escapementType:short

super or subscript option

See Also
Font#SS_NONE, Font#SS_SUPER, Font#SS_SUB
setFontColorback to summary
public void setFontColor(Color color)

Sets the colour to use

Parameters
color:Color

font colour to use

setFontColorIndexback to summary
public void setFontColorIndex(short color)

Sets the indexed colour to use

Parameters
color:short

font colour index

setFontHeightback to summary
public void setFontHeight(int height)

Sets the height of the font in 1/20th point units

Parameters
height:int

the height in twips (in points/20)

setFontStyleback to summary
public void setFontStyle(boolean italic, boolean bold)

set font style options.

Parameters
italic:boolean

- if true, set posture style to italic, otherwise to normal

bold:boolean

if true, set font weight to bold, otherwise to normal

setUnderlineTypeback to summary
public void setUnderlineType(short underlineType)

set the type of underlining type for the font

Parameters
underlineType:short

super or subscript option

See Also
Font#U_NONE, Font#U_SINGLE, Font#U_DOUBLE, Font#U_SINGLE_ACCOUNTING, Font#U_DOUBLE_ACCOUNTING