Package org.apache.poi.hssf.usermodel
Class HSSFFontFormatting
java.lang.Object
org.apache.poi.hssf.usermodel.HSSFFontFormatting
- All Implemented Interfaces:
FontFormatting
High level representation for Font Formatting component
of Conditional Formatting settings
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteUnderline type - Doublestatic final byteUnderline type - Double Accountingstatic final byteUnderline type - Nonestatic final byteUnderline type - Singlestatic final byteUnderline type - Single AccountingFields inherited from interface org.apache.poi.ss.usermodel.FontFormatting
SS_NONE, SS_SUB, SS_SUPER -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHSSFFontFormatting(CFRuleBase cfRuleRecord, HSSFWorkbook workbook) -
Method Summary
Modifier and TypeMethodDescriptionshortget the type of super or subscript for the fontshortprotected FontFormattingintgets the height of the font in 1/20th point unitsshortget the font weight for this font (100-1000dec or 0x64-0x3e8).protected byte[]shortget the type of underlining for the fontbooleanisBold()get whether the font weight is set to bold or notbooleanbooleanbooleanbooleanbooleanbooleanbooleanisItalic()booleanbooleanbooleanbooleanvoidset font style options to default values (non-italic, non-bold)voidsetEscapementType(short escapementType) set the escapement type for the fontvoidsetEscapementTypeModified(boolean modified) voidsetFontCancellationModified(boolean modified) voidsetFontColor(Color color) Sets the colour to usevoidsetFontColorIndex(short fci) Sets the indexed colour to usevoidsetFontHeight(int height) Sets the height of the font in 1/20th point unitsvoidsetFontOutlineModified(boolean modified) voidsetFontShadowModified(boolean modified) voidsetFontStyle(boolean italic, boolean bold) set font style options.voidsetFontStyleModified(boolean modified) voidsetOutline(boolean on) voidsetShadow(boolean on) voidsetStrikeout(boolean strike) voidsetUnderlineType(short underlineType) set the type of underlining type for the fontvoidsetUnderlineTypeModified(boolean modified)
-
Field Details
-
U_NONE
public static final byte U_NONEUnderline type - None- See Also:
-
U_SINGLE
public static final byte U_SINGLEUnderline type - Single- See Also:
-
U_DOUBLE
public static final byte U_DOUBLEUnderline type - Double- See Also:
-
U_SINGLE_ACCOUNTING
public static final byte U_SINGLE_ACCOUNTINGUnderline type - Single Accounting- See Also:
-
U_DOUBLE_ACCOUNTING
public static final byte U_DOUBLE_ACCOUNTINGUnderline type - Double Accounting- See Also:
-
-
Constructor Details
-
HSSFFontFormatting
-
-
Method Details
-
getFontFormattingBlock
-
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:
-
getFontColorIndex
public short getFontColorIndex()- Specified by:
getFontColorIndexin interfaceFontFormatting- Returns:
- font color index
-
getFontColor
- Specified by:
getFontColorin interfaceFontFormatting- Returns:
- The colour of the font, or null if no colour applied
-
setFontColor
Description copied from interface:FontFormattingSets the colour to use- Specified by:
setFontColorin interfaceFontFormatting- Parameters:
color- font colour to use
-
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
-
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"
-
getRawRecord
protected byte[] getRawRecord()- See Also:
-
getUnderlineType
public short getUnderlineType()get the type of underlining for the font- Specified by:
getUnderlineTypein interfaceFontFormatting- Returns:
- font underlining type
- 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
-
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:
isItalicin 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:
isStruckoutin 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:
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
-
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:
-
setEscapementTypeModified
public void setEscapementTypeModified(boolean modified) - Parameters:
modified-- See Also:
-
setFontCancellationModified
public void setFontCancellationModified(boolean modified) - Parameters:
modified-- See Also:
-
setFontColorIndex
public void setFontColorIndex(short fci) Description copied from interface:FontFormattingSets the indexed colour to use- Specified by:
setFontColorIndexin interfaceFontFormatting- Parameters:
fci-- See Also:
-
setFontHeight
public void setFontHeight(int height) Description copied from interface:FontFormattingSets the height of the font in 1/20th point units- Specified by:
setFontHeightin interfaceFontFormatting- Parameters:
height-- See Also:
-
setFontOutlineModified
public void setFontOutlineModified(boolean modified) - Parameters:
modified-- See Also:
-
setFontShadowModified
public void setFontShadowModified(boolean modified) - Parameters:
modified-- See Also:
-
setFontStyleModified
public void setFontStyleModified(boolean modified) - Parameters:
modified-- See Also:
-
setOutline
public void setOutline(boolean on) - Parameters:
on-- See Also:
-
setShadow
public void setShadow(boolean on) - Parameters:
on-- See Also:
-
setStrikeout
public void setStrikeout(boolean strike) - Parameters:
strike-- 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:
-
setUnderlineTypeModified
public void setUnderlineTypeModified(boolean modified) - Parameters:
modified-- See Also:
-