Package org.apache.poi.ss.usermodel
Interface FontFormatting
- All Known Implementing Classes:
HSSFFontFormatting,XSSFFontFormatting
public interface FontFormatting
High level representation for Font Formatting component
of Conditional Formatting settings
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortEscapement type - Nonestatic final shortEscapement type - Subscriptstatic final shortEscapement type - Superscriptstatic final byteUnderline type - Doublestatic final byteUnderline type - Double Accountingstatic final byteUnderline type - Nonestatic final byteUnderline type - Singlestatic final byteUnderline type - Single Accounting -
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()booleanvoidset font style options to default values (non-italic, non-bold)voidsetEscapementType(short escapementType) set the escapement type for the fontvoidsetFontColor(Color color) Sets the colour to usevoidsetFontColorIndex(short color) Sets the indexed colour to usevoidsetFontHeight(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
-
Field Details
-
SS_NONE
static final short SS_NONEEscapement type - None- See Also:
-
SS_SUPER
static final short SS_SUPEREscapement type - Superscript- See Also:
-
SS_SUB
static final short SS_SUBEscapement type - Subscript- See Also:
-
U_NONE
static final byte U_NONEUnderline type - None- See Also:
-
U_SINGLE
static final byte U_SINGLEUnderline type - Single- See Also:
-
U_DOUBLE
static final byte U_DOUBLEUnderline type - Double- See Also:
-
U_SINGLE_ACCOUNTING
static final byte U_SINGLE_ACCOUNTINGUnderline type - Single Accounting- See Also:
-
U_DOUBLE_ACCOUNTING
static final byte U_DOUBLE_ACCOUNTINGUnderline type - Double Accounting- See Also:
-
-
Method Details
-
getEscapementType
short getEscapementType()get the type of super or subscript for the font -
setEscapementType
void setEscapementType(short escapementType) set the escapement type for the font -
getFontColorIndex
short getFontColorIndex()- Returns:
- font colour index, or 0 if not indexed (XSSF only)
-
setFontColorIndex
void setFontColorIndex(short color) Sets the indexed colour to use- Parameters:
color- font colour index
-
getFontColor
Color getFontColor()- Returns:
- The colour of the font, or null if no colour applied
-
setFontColor
Sets the colour to use- Parameters:
color- font colour to use
-
getFontHeight
int getFontHeight()gets the height of the font in 1/20th point units- Returns:
- fontheight (in points/20); or -1 if not modified
-
setFontHeight
void setFontHeight(int height) Sets the height of the font in 1/20th point units- Parameters:
height- the height in twips (in points/20)
-
getUnderlineType
short getUnderlineType()get the type of underlining for the font- Returns:
- font underlining type
- See Also:
-
setUnderlineType
void setUnderlineType(short underlineType) set the type of underlining type for the font- Parameters:
underlineType- super or subscript option- See Also:
-
isBold
boolean isBold()get whether the font weight is set to bold or not- Returns:
- bold - whether the font is bold or not
-
isItalic
boolean isItalic()- Returns:
- true if font style was set to italic
-
isStruckout
boolean isStruckout()- Returns:
- true if font strikeout is on
-
setFontStyle
void setFontStyle(boolean italic, boolean bold) set font style options.- Parameters:
italic- - if true, set posture style to italic, otherwise to normalbold- if true, set font weight to bold, otherwise to normal
-
resetFontStyle
void resetFontStyle()set font style options to default values (non-italic, non-bold)
-