Package org.apache.poi.xssf.usermodel
Class XSSFFontFormatting
java.lang.Object
org.apache.poi.xssf.usermodel.XSSFFontFormatting
- All Implemented Interfaces:
FontFormatting
-
Method Summary
Modifier and TypeMethodDescriptionshortget the type of super or subscript for the fontshortintgets the height of the font in 1/20th point unitsshortget the type of underlining for the fontbooleanisBold()get whether the font weight is set to bold or notbooleanisItalic()booleanXMLBeans and the XSD make this look like it can have multiple values, but it is maxOccurs=1.voidset font style options to default values (non-italic, non-bold)voidsetEscapementType(short escapementType) set the escapement type for the fontvoidsetFontColor(Color color) voidsetFontColorIndex(short color) voidsetFontHeight(int height) Sets the height of the font in 1/20th point unitsvoidsetFontStyle(boolean italic, boolean bold) set font style options.voidsetUnderlineType(short underlineType) set the type of underlining type for the font
-
Method Details
-
getEscapementType
public short getEscapementType()get the type of super or subscript for the font- Specified by:
getEscapementTypein interfaceFontFormatting- Returns:
- super or subscript option
- See Also:
-
setEscapementType
public void setEscapementType(short escapementType) set the escapement type for the font- Specified by:
setEscapementTypein interfaceFontFormatting- Parameters:
escapementType- super or subscript option- See Also:
-
isStruckout
public boolean isStruckout()XMLBeans and the XSD make this look like it can have multiple values, but it is maxOccurs=1. Use get*Array(), it is much faster than get*List().- Specified by:
isStruckoutin interfaceFontFormatting- See Also:
-
getFontColorIndex
public short getFontColorIndex()- Specified by:
getFontColorIndexin interfaceFontFormatting- Returns:
- font color index
-
setFontColorIndex
public void setFontColorIndex(short color) - Specified by:
setFontColorIndexin interfaceFontFormatting- Parameters:
color- font color index
-
getFontColor
- Specified by:
getFontColorin interfaceFontFormatting
-
setFontColor
- Specified by:
setFontColorin interfaceFontFormatting
-
getFontHeight
public int getFontHeight()gets the height of the font in 1/20th point units- Specified by:
getFontHeightin 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:
setFontHeightin interfaceFontFormatting- Parameters:
height- the height in twips (in points/20)
-
getUnderlineType
public short getUnderlineType()get the type of underlining for the font- Specified by:
getUnderlineTypein interfaceFontFormatting- Returns:
- font underlining type
- See Also:
-
setUnderlineType
public void setUnderlineType(short underlineType) set the type of underlining type for the font- Specified by:
setUnderlineTypein interfaceFontFormatting- Parameters:
underlineType- super or subscript option- See Also:
-
isBold
public boolean isBold()get whether the font weight is set to bold or not- Specified by:
isBoldin interfaceFontFormatting- Returns:
- bold - whether the font is bold or not
-
isItalic
public boolean isItalic()- Specified by:
isItalicin interfaceFontFormatting- Returns:
- true if font style was set to italic
-
setFontStyle
public void setFontStyle(boolean italic, boolean bold) set font style options.- Specified by:
setFontStylein 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:
resetFontStylein interfaceFontFormatting
-