Package org.apache.poi.xssf.usermodel
Class XSSFFontFormatting
- java.lang.Object
-
- org.apache.poi.xssf.usermodel.XSSFFontFormatting
-
- All Implemented Interfaces:
FontFormatting
public class XSSFFontFormatting extends Object implements FontFormatting
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description short
getEscapementType()
get the type of super or subscript for the fontXSSFColor
getFontColor()
short
getFontColorIndex()
int
getFontHeight()
gets the height of the font in 1/20th point unitsshort
getUnderlineType()
get the type of underlining for the fontboolean
isBold()
get whether the font weight is set to bold or notboolean
isItalic()
boolean
isStruckout()
XMLBeans and the XSD make this look like it can have multiple values, but it is maxOccurrs=1.void
resetFontStyle()
set font style options to default values (non-italic, non-bold)void
setEscapementType(short escapementType)
set the escapement type for the fontvoid
setFontColor(Color color)
void
setFontColorIndex(short color)
void
setFontHeight(int height)
Sets the height of the font in 1/20th point unitsvoid
setFontStyle(boolean italic, boolean bold)
set font style options.void
setUnderlineType(short underlineType)
set the type of underlining type for the font
-
-
-
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
-
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
-
isStruckout
public boolean isStruckout()
XMLBeans and the XSD make this look like it can have multiple values, but it is maxOccurrs=1. Use get*Array(), it is much faster than get*List().- Specified by:
isStruckout
in interfaceFontFormatting
- See Also:
FontFormatting.isStruckout()
-
getFontColorIndex
public short getFontColorIndex()
- Specified by:
getFontColorIndex
in interfaceFontFormatting
- Returns:
- font color index
-
setFontColorIndex
public void setFontColorIndex(short color)
- Specified by:
setFontColorIndex
in interfaceFontFormatting
- Parameters:
color
- font color index
-
getFontColor
public XSSFColor getFontColor()
- Specified by:
getFontColor
in interfaceFontFormatting
-
setFontColor
public void setFontColor(Color color)
- Specified by:
setFontColor
in interfaceFontFormatting
-
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
-
setFontHeight
public void setFontHeight(int height)
Sets the height of the font in 1/20th point units- Specified by:
setFontHeight
in interfaceFontFormatting
- Parameters:
height
- the height in twips (in points/20)
-
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
-
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
-
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
-
isItalic
public boolean isItalic()
- Specified by:
isItalic
in interfaceFontFormatting
- Returns:
- true if font style was set to italic
-
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
-
-