Package org.apache.poi.hssf.usermodel
Class HSSFFontFormatting
- java.lang.Object
-
- org.apache.poi.hssf.usermodel.HSSFFontFormatting
-
- All Implemented Interfaces:
FontFormatting
public final class HSSFFontFormatting extends Object implements FontFormatting
High level representation for Font Formatting component of Conditional Formatting settings
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description short
getEscapementType()
get the type of super or subscript for the fontHSSFColor
getFontColor()
short
getFontColorIndex()
int
getFontHeight()
gets the height of the font in 1/20th point unitsshort
getFontWeight()
get the font weight for this font (100-1000dec or 0x64-0x3e8).short
getUnderlineType()
get the type of underlining for the fontboolean
isBold()
get whether the font weight is set to bold or notboolean
isEscapementTypeModified()
boolean
isFontCancellationModified()
boolean
isFontOutlineModified()
boolean
isFontShadowModified()
boolean
isFontStyleModified()
boolean
isFontWeightModified()
boolean
isItalic()
boolean
isOutlineOn()
boolean
isShadowOn()
boolean
isStruckout()
boolean
isUnderlineTypeModified()
void
resetFontStyle()
set font style options to default values (non-italic, non-bold)void
setEscapementType(short escapementType)
set the escapement type for the fontvoid
setEscapementTypeModified(boolean modified)
void
setFontCancellationModified(boolean modified)
void
setFontColor(Color color)
Sets the colour to usevoid
setFontColorIndex(short fci)
Sets the indexed colour to usevoid
setFontHeight(int height)
Sets the height of the font in 1/20th point unitsvoid
setFontOutlineModified(boolean modified)
void
setFontShadowModified(boolean modified)
void
setFontStyle(boolean italic, boolean bold)
set font style options.void
setFontStyleModified(boolean modified)
void
setOutline(boolean on)
void
setShadow(boolean on)
void
setStrikeout(boolean strike)
void
setUnderlineType(short underlineType)
set the type of underlining type for the fontvoid
setUnderlineTypeModified(boolean modified)
-
-
-
Method Detail
-
getEscapementType
public short getEscapementType()
get the type of super or subscript for the font- Specified by:
getEscapementType
in interfaceFontFormatting
- Returns:
- super or subscript option
- See Also:
Font.SS_NONE
,Font.SS_SUPER
,Font.SS_SUB
-
getFontColorIndex
public short getFontColorIndex()
- Specified by:
getFontColorIndex
in interfaceFontFormatting
- Returns:
- font color index
-
getFontColor
public HSSFColor getFontColor()
- Specified by:
getFontColor
in interfaceFontFormatting
- Returns:
- The colour of the font, or null if no colour applied
-
setFontColor
public void setFontColor(Color color)
Description copied from interface:FontFormatting
Sets the colour to use- Specified by:
setFontColor
in interfaceFontFormatting
- Parameters:
color
- font colour to use
-
getFontHeight
public int getFontHeight()
gets the height of the font in 1/20th point units- Specified by:
getFontHeight
in interfaceFontFormatting
- Returns:
- fontheight (in points/20); or -1 if not modified
-
getFontWeight
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:
- bw - a number between 100-1000 for the fonts "boldness"
-
getUnderlineType
public short getUnderlineType()
get the type of underlining for the font- Specified by:
getUnderlineType
in interfaceFontFormatting
- Returns:
- font underlining type
- See Also:
Font.U_NONE
,Font.U_SINGLE
,Font.U_DOUBLE
,Font.U_SINGLE_ACCOUNTING
,Font.U_DOUBLE_ACCOUNTING
-
isBold
public boolean isBold()
get whether the font weight is set to bold or not- Specified by:
isBold
in interfaceFontFormatting
- Returns:
- bold - whether the font is bold or not
-
isEscapementTypeModified
public boolean isEscapementTypeModified()
- Returns:
- true if escapement type was modified from default
-
isFontCancellationModified
public boolean isFontCancellationModified()
- Returns:
- true if font cancellation was modified from default
-
isFontOutlineModified
public boolean isFontOutlineModified()
- Returns:
- true if font outline type was modified from default
-
isFontShadowModified
public boolean isFontShadowModified()
- Returns:
- true if font shadow type was modified from default
-
isFontStyleModified
public boolean isFontStyleModified()
- Returns:
- true if font style was modified from default
-
isItalic
public boolean isItalic()
- Specified by:
isItalic
in interfaceFontFormatting
- Returns:
- true if font style was set to italic
-
isOutlineOn
public boolean isOutlineOn()
- Returns:
- true if font outline is on
-
isShadowOn
public boolean isShadowOn()
- Returns:
- true if font shadow is on
-
isStruckout
public boolean isStruckout()
- Specified by:
isStruckout
in interfaceFontFormatting
- Returns:
- true if font strikeout is on
-
isUnderlineTypeModified
public boolean isUnderlineTypeModified()
- Returns:
- true if font underline type was modified from default
-
isFontWeightModified
public boolean isFontWeightModified()
- Returns:
- true if font weight was modified from default
-
setFontStyle
public void setFontStyle(boolean italic, boolean bold)
set font style options.- Specified by:
setFontStyle
in interfaceFontFormatting
- Parameters:
italic
- - if true, set posture style to italic, otherwise to normalbold
- if true, set font weight to bold, otherwise to normal
-
resetFontStyle
public void resetFontStyle()
set font style options to default values (non-italic, non-bold)- Specified by:
resetFontStyle
in interfaceFontFormatting
-
setEscapementType
public void setEscapementType(short escapementType)
set the escapement type for the font- Specified by:
setEscapementType
in interfaceFontFormatting
- Parameters:
escapementType
- super or subscript option- See Also:
Font.SS_NONE
,Font.SS_SUPER
,Font.SS_SUB
-
setEscapementTypeModified
public void setEscapementTypeModified(boolean modified)
- Parameters:
modified
- flag, if escapement type is modified- See Also:
FontFormatting.setEscapementTypeModified(boolean)
-
setFontCancellationModified
public void setFontCancellationModified(boolean modified)
- Parameters:
modified
- flag, if font cancellation is modified- See Also:
FontFormatting.setFontCancellationModified(boolean)
-
setFontColorIndex
public void setFontColorIndex(short fci)
Description copied from interface:FontFormatting
Sets the indexed colour to use- Specified by:
setFontColorIndex
in interfaceFontFormatting
- Parameters:
fci
- the font color index- See Also:
FontFormatting.setFontColorIndex(short)
-
setFontHeight
public void setFontHeight(int height)
Description copied from interface:FontFormatting
Sets the height of the font in 1/20th point units- Specified by:
setFontHeight
in interfaceFontFormatting
- Parameters:
height
- the font height- See Also:
FontFormatting.setFontHeight(int)
-
setFontOutlineModified
public void setFontOutlineModified(boolean modified)
- Parameters:
modified
- flag, if font outline is modified- See Also:
FontFormatting.setFontOutlineModified(boolean)
-
setFontShadowModified
public void setFontShadowModified(boolean modified)
- Parameters:
modified
- flag, if font shadow is modified- See Also:
FontFormatting.setFontShadowModified(boolean)
-
setFontStyleModified
public void setFontStyleModified(boolean modified)
- Parameters:
modified
- flag, if font style is modified- See Also:
FontFormatting.setFontStyleModified(boolean)
-
setOutline
public void setOutline(boolean on)
- Parameters:
on
- flag, if outline is set- See Also:
FontFormatting.setOutline(boolean)
-
setShadow
public void setShadow(boolean on)
- Parameters:
on
- flag, if shadow is set- See Also:
FontFormatting.setShadow(boolean)
-
setStrikeout
public void setStrikeout(boolean strike)
- Parameters:
strike
- flag, if strikeout is set- See Also:
FontFormatting.setStrikeout(boolean)
-
setUnderlineType
public void setUnderlineType(short underlineType)
set the type of underlining type for the font- Specified by:
setUnderlineType
in interfaceFontFormatting
- Parameters:
underlineType
- super or subscript option- See Also:
Font.U_NONE
,Font.U_SINGLE
,Font.U_DOUBLE
,Font.U_SINGLE_ACCOUNTING
,Font.U_DOUBLE_ACCOUNTING
-
setUnderlineTypeModified
public void setUnderlineTypeModified(boolean modified)
- Parameters:
modified
- flag, if underline type is modified- See Also:
FontFormatting.setUnderlineTypeModified(boolean)
-
-