Top Description Fields Constructors Methods
org.apache.poi.hssf.usermodel

public final Class HSSFFontFormatting

extends Object
implements FontFormatting
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.usermodel.FontFormatting
Annotations
@SuppressWarnings:unused
Imports
org.apache.poi.hssf.record.CFRuleBase, org.apache.poi.hssf.record.cf.FontFormatting, org.apache.poi.hssf.util.HSSFColor, org.apache.poi.ss.usermodel.Color

High level representation for Font Formatting component of Conditional Formatting settings

Field Summary

Modifier and TypeField and Description
private final FontFormatting
private final HSSFWorkbook

Constructor Summary

AccessConstructor and Description
pack-priv
HSSFFontFormatting(CFRuleBase cfRuleRecord, HSSFWorkbook workbook)

Method Summary

Modifier and TypeMethod and Description
public short

Returns:

super or subscript option
getEscapementType
()

Implements org.apache.poi.ss.usermodel.FontFormatting.getEscapementType.

get the type of super or subscript for the font

public HSSFColor
public short
pack-priv FontFormatting
public int

Returns:

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

Implements org.apache.poi.ss.usermodel.FontFormatting.getFontHeight.

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

public short

Returns:

bw - a number between 100-1000 for the fonts "boldness"
getFontWeight
()

get the font weight for this font (100-1000dec or 0x64-0x3e8).

pack-priv byte[]
public short

Returns:

font underlining type
getUnderlineType
()

Implements org.apache.poi.ss.usermodel.FontFormatting.getUnderlineType.

get the type of underlining for the font

public boolean

Returns:

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

Implements org.apache.poi.ss.usermodel.FontFormatting.isBold.

get whether the font weight is set to bold or not

public boolean

Returns:

true if escapement type was modified from default
isEscapementTypeModified
()

public boolean

Returns:

true if font cancellation was modified from default
isFontCancellationModified
()

public boolean

Returns:

true if font outline type was modified from default
isFontOutlineModified
()

public boolean

Returns:

true if font shadow type was modified from default
isFontShadowModified
()

public boolean

Returns:

true if font style was modified from default
isFontStyleModified
()

public boolean

Returns:

true if font weight was modified from default
isFontWeightModified
()

public boolean

Returns:

true if font style was set to italic
isItalic
()

Implements org.apache.poi.ss.usermodel.FontFormatting.isItalic.

public boolean

Returns:

true if font outline is on
isOutlineOn
()

public boolean

Returns:

true if font shadow is on
isShadowOn
()

public boolean

Returns:

true if font strikeout is on
isStruckout
()

Implements org.apache.poi.ss.usermodel.FontFormatting.isStruckout.

public boolean

Returns:

true if font underline type was modified from default
isUnderlineTypeModified
()

public void
resetFontStyle()

Implements org.apache.poi.ss.usermodel.FontFormatting.resetFontStyle.

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

public void
setEscapementType(short
super or subscript option
escapementType
)

Implements org.apache.poi.ss.usermodel.FontFormatting.setEscapementType.

set the escapement type for the font

public void
setEscapementTypeModified(boolean
flag, if escapement type is modified
modified
)

public void
setFontCancellationModified(boolean
flag, if font cancellation is modified
modified
)

public void
setFontColor(Color
font colour to use
color
)

Implements org.apache.poi.ss.usermodel.FontFormatting.setFontColor.

Sets the colour to use

public void
setFontColorIndex(short
the font color index
fci
)

Implements org.apache.poi.ss.usermodel.FontFormatting.setFontColorIndex.

Sets the indexed colour to use

public void
setFontHeight(int
the font height
height
)

Implements org.apache.poi.ss.usermodel.FontFormatting.setFontHeight.

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

public void
setFontOutlineModified(boolean
flag, if font outline is modified
modified
)

public void
setFontShadowModified(boolean
flag, if font shadow is modified
modified
)

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
)

Implements org.apache.poi.ss.usermodel.FontFormatting.setFontStyle.

set font style options.

public void
setFontStyleModified(boolean
flag, if font style is modified
modified
)

public void
setOutline(boolean
flag, if outline is set
on
)

public void
setShadow(boolean
flag, if shadow is set
on
)

public void
setStrikeout(boolean
flag, if strikeout is set
strike
)

public void
setUnderlineType(short
super or subscript option
underlineType
)

Implements org.apache.poi.ss.usermodel.FontFormatting.setUnderlineType.

set the type of underlining type for the font

public void
setUnderlineTypeModified(boolean
flag, if underline type is modified
modified
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fontFormattingback to summary
private final FontFormatting fontFormatting
workbookback to summary
private final HSSFWorkbook workbook

Constructor Detail

HSSFFontFormattingback to summary
pack-priv HSSFFontFormatting(CFRuleBase cfRuleRecord, HSSFWorkbook workbook)

Method Detail

getEscapementTypeback to summary
public short getEscapementType()

Implements org.apache.poi.ss.usermodel.FontFormatting.getEscapementType.

get the type of super or subscript for the font

Returns:short

super or subscript option

See Also
org.apache.poi.ss.usermodel.Font#SS_NONE, org.apache.poi.ss.usermodel.Font#SS_SUPER, org.apache.poi.ss.usermodel.Font#SS_SUB
getFontColorback to summary
public HSSFColor getFontColor()

Implements org.apache.poi.ss.usermodel.FontFormatting.getFontColor.

Returns:HSSFColor

Doc from org.apache.poi.ss.usermodel.FontFormatting.getFontColor.

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

getFontColorIndexback to summary
public short getFontColorIndex()

Implements org.apache.poi.ss.usermodel.FontFormatting.getFontColorIndex.

Returns:short

font color index

getFontFormattingBlockback to summary
pack-priv FontFormatting getFontFormattingBlock()
getFontHeightback to summary
public int getFontHeight()

Implements org.apache.poi.ss.usermodel.FontFormatting.getFontHeight.

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

Returns:int

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

getFontWeightback to summary
public short getFontWeight()

get the font weight for this font (100-1000dec or 0x64-0x3e8). Default is 0x190 for normal and 0x2bc for bold

Returns:short

bw - a number between 100-1000 for the fonts "boldness"

getRawRecordback to summary
pack-priv byte[] getRawRecord()
See Also
org.apache.poi.hssf.record.cf.FontFormatting#getRawRecord()
getUnderlineTypeback to summary
public short getUnderlineType()

Implements org.apache.poi.ss.usermodel.FontFormatting.getUnderlineType.

get the type of underlining for the font

Returns:short

font underlining type

See Also
org.apache.poi.ss.usermodel.Font#U_NONE, org.apache.poi.ss.usermodel.Font#U_SINGLE, org.apache.poi.ss.usermodel.Font#U_DOUBLE, org.apache.poi.ss.usermodel.Font#U_SINGLE_ACCOUNTING, org.apache.poi.ss.usermodel.Font#U_DOUBLE_ACCOUNTING
isBoldback to summary
public boolean isBold()

Implements org.apache.poi.ss.usermodel.FontFormatting.isBold.

get whether the font weight is set to bold or not

Returns:boolean

bold - whether the font is bold or not

isEscapementTypeModifiedback to summary
public boolean isEscapementTypeModified()
Returns:boolean

true if escapement type was modified from default

isFontCancellationModifiedback to summary
public boolean isFontCancellationModified()
Returns:boolean

true if font cancellation was modified from default

isFontOutlineModifiedback to summary
public boolean isFontOutlineModified()
Returns:boolean

true if font outline type was modified from default

isFontShadowModifiedback to summary
public boolean isFontShadowModified()
Returns:boolean

true if font shadow type was modified from default

isFontStyleModifiedback to summary
public boolean isFontStyleModified()
Returns:boolean

true if font style was modified from default

isFontWeightModifiedback to summary
public boolean isFontWeightModified()
Returns:boolean

true if font weight was modified from default

isItalicback to summary
public boolean isItalic()

Implements org.apache.poi.ss.usermodel.FontFormatting.isItalic.

Returns:boolean

true if font style was set to italic

isOutlineOnback to summary
public boolean isOutlineOn()
Returns:boolean

true if font outline is on

isShadowOnback to summary
public boolean isShadowOn()
Returns:boolean

true if font shadow is on

isStruckoutback to summary
public boolean isStruckout()

Implements org.apache.poi.ss.usermodel.FontFormatting.isStruckout.

Returns:boolean

true if font strikeout is on

isUnderlineTypeModifiedback to summary
public boolean isUnderlineTypeModified()
Returns:boolean

true if font underline type was modified from default

resetFontStyleback to summary
public void resetFontStyle()

Implements org.apache.poi.ss.usermodel.FontFormatting.resetFontStyle.

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

setEscapementTypeback to summary
public void setEscapementType(short escapementType)

Implements org.apache.poi.ss.usermodel.FontFormatting.setEscapementType.

set the escapement type for the font

Parameters
escapementType:short

super or subscript option

See Also
org.apache.poi.ss.usermodel.Font#SS_NONE, org.apache.poi.ss.usermodel.Font#SS_SUPER, org.apache.poi.ss.usermodel.Font#SS_SUB
setEscapementTypeModifiedback to summary
public void setEscapementTypeModified(boolean modified)
Parameters
modified:boolean

flag, if escapement type is modified

See Also
org.apache.poi.hssf.record.cf.FontFormatting#setEscapementTypeModified(boolean)
setFontCancellationModifiedback to summary
public void setFontCancellationModified(boolean modified)
Parameters
modified:boolean

flag, if font cancellation is modified

See Also
org.apache.poi.hssf.record.cf.FontFormatting#setFontCancellationModified(boolean)
setFontColorback to summary
public void setFontColor(Color color)

Implements org.apache.poi.ss.usermodel.FontFormatting.setFontColor.

Doc from org.apache.poi.ss.usermodel.FontFormatting.setFontColor.

Sets the colour to use

Parameters
color:Color

font colour to use

setFontColorIndexback to summary
public void setFontColorIndex(short fci)

Implements org.apache.poi.ss.usermodel.FontFormatting.setFontColorIndex.

Doc from org.apache.poi.ss.usermodel.FontFormatting.setFontColorIndex.

Sets the indexed colour to use

Parameters
fci:short

the font color index

See Also
org.apache.poi.hssf.record.cf.FontFormatting#setFontColorIndex(short)
setFontHeightback to summary
public void setFontHeight(int height)

Implements org.apache.poi.ss.usermodel.FontFormatting.setFontHeight.

Doc from org.apache.poi.ss.usermodel.FontFormatting.setFontHeight.

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

Parameters
height:int

the font height

See Also
org.apache.poi.hssf.record.cf.FontFormatting#setFontHeight(int)
setFontOutlineModifiedback to summary
public void setFontOutlineModified(boolean modified)
Parameters
modified:boolean

flag, if font outline is modified

See Also
org.apache.poi.hssf.record.cf.FontFormatting#setFontOutlineModified(boolean)
setFontShadowModifiedback to summary
public void setFontShadowModified(boolean modified)
Parameters
modified:boolean

flag, if font shadow is modified

See Also
org.apache.poi.hssf.record.cf.FontFormatting#setFontShadowModified(boolean)
setFontStyleback to summary
public void setFontStyle(boolean italic, boolean bold)

Implements org.apache.poi.ss.usermodel.FontFormatting.setFontStyle.

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

setFontStyleModifiedback to summary
public void setFontStyleModified(boolean modified)
Parameters
modified:boolean

flag, if font style is modified

See Also
org.apache.poi.hssf.record.cf.FontFormatting#setFontStyleModified(boolean)
setOutlineback to summary
public void setOutline(boolean on)
Parameters
on:boolean

flag, if outline is set

See Also
org.apache.poi.hssf.record.cf.FontFormatting#setOutline(boolean)
setShadowback to summary
public void setShadow(boolean on)
Parameters
on:boolean

flag, if shadow is set

See Also
org.apache.poi.hssf.record.cf.FontFormatting#setShadow(boolean)
setStrikeoutback to summary
public void setStrikeout(boolean strike)
Parameters
strike:boolean

flag, if strikeout is set

See Also
org.apache.poi.hssf.record.cf.FontFormatting#setStrikeout(boolean)
setUnderlineTypeback to summary
public void setUnderlineType(short underlineType)

Implements org.apache.poi.ss.usermodel.FontFormatting.setUnderlineType.

set the type of underlining type for the font

Parameters
underlineType:short

super or subscript option

See Also
org.apache.poi.ss.usermodel.Font#U_NONE, org.apache.poi.ss.usermodel.Font#U_SINGLE, org.apache.poi.ss.usermodel.Font#U_DOUBLE, org.apache.poi.ss.usermodel.Font#U_SINGLE_ACCOUNTING, org.apache.poi.ss.usermodel.Font#U_DOUBLE_ACCOUNTING
setUnderlineTypeModifiedback to summary
public void setUnderlineTypeModified(boolean modified)
Parameters
modified:boolean

flag, if underline type is modified

See Also
org.apache.poi.hssf.record.cf.FontFormatting#setUnderlineTypeModified(boolean)