Top Description Fields Constructors Methods
org.apache.poi.hssf.record.cf

public final Class FontFormatting

extends Object
implements Duplicatable, GenericRecord
Class Inheritance
All Implemented Interfaces
org.apache.poi.common.usermodel.GenericRecord, org.apache.poi.common.Duplicatable
Static Imports
org.apache.poi.util.GenericRecordUtil.getBitsAsString, .GenericRecordUtil.getEnumBitsAsString

Font Formatting Block of the Conditional Formatting Rule Record.

Field Summary

Modifier and TypeField and Description
private final byte[]
private static final BitField
public static final int
private static final short
FONT_WEIGHT_BOLD

Bold boldness (bold)

private static final short
FONT_WEIGHT_NORMAL

Normal boldness (not bold)

private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final BitField
private static final BitField
private static final int
private static final BitField

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public FontFormatting
public int
public short

Returns:

super or subscript option
getEscapementType
()

get the type of super or subscript for the font

public short
public int

Returns:

fontheight (in points/20); or -1 if not modified
getFontHeight
()

gets the height of the font in 1/20th point units

private boolean
public short

Returns:

bw - a number between 100-1000 for the fonts "boldness"
getFontWeight
()

get the font weight for this font (100-1000dec or 0x64-0x3e8).

public Map<String, Supplier<?>>
private int
getInt(int offset)

private boolean
public byte[]
private short
getShort(int offset)

public short

Returns:

font underlining type
getUnderlineType
()

get the type of underlining for the font

public boolean

Returns:

bold - whether the font is bold or not
isBold
()

get whether the font weight is set to bold or not

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean

Returns:

italics - whether the font is italics or not
isItalic
()

get whether the font is to be italics or not

public boolean
public boolean
public boolean

Returns:

strike - whether the font is stricken out or not
isStruckout
()

get whether the font is to be stricken out or not

public boolean
public void
setBold(boolean
- set font weight to bold if true; to normal otherwise
bold
)

set the font weight to bold (weight=700) or to normal(weight=400) boldness.

public void
setEscapementType(short
super or subscript option
escapementType
)

set the escapement type for the font

public void
setEscapementTypeModified(boolean modified)

public void
setFontCancellationModified(boolean modified)

public void
setFontColorIndex(short fci)

public void
setFontHeight(int
fontheight (in points/20); or -1 to preserve the cell font height
height
)

sets the height of the font in 1/20th point units

private void
setFontOption(boolean option, BitField field)

public void
setFontOutlineModified(boolean modified)

public void
setFontShadowModified(boolean modified)

public void
setFontStyleModified(boolean modified)

private void
setFontWeight(short
- a number between 100-1000 for the fonts "boldness"
bw
)

set the font weight (100-1000dec or 0x64-0x3e8).

public void
setFontWieghtModified(boolean modified)

private void
setInt(int offset, int value)

public void
setItalic(boolean
- whether the font is italics or not
italic
)

set the font to be italics or not

private void
setOptionFlag(boolean modified, BitField field)

public void
setOutline(boolean on)

public void
setShadow(boolean on)

private void
setShort(int offset, int value)

public void
setStrikeout(boolean
- whether the font is stricken out or not
strike
)

set the font to be stricken out or not

public void
setUnderlineType(short
underline option
underlineType
)

set the type of underlining type for the font

public void
setUnderlineTypeModified(boolean modified)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_rawDataback to summary
private final byte[] _rawData
CANCELLATIONback to summary
private static final BitField CANCELLATION
FONT_CELL_HEIGHT_PRESERVEDback to summary
public static final int FONT_CELL_HEIGHT_PRESERVED
FONT_WEIGHT_BOLDback to summary
private static final short FONT_WEIGHT_BOLD

Bold boldness (bold)

FONT_WEIGHT_NORMALback to summary
private static final short FONT_WEIGHT_NORMAL

Normal boldness (not bold)

OFFSET_ESCAPEMENT_TYPEback to summary
private static final int OFFSET_ESCAPEMENT_TYPE
OFFSET_ESCAPEMENT_TYPE_MODIFIEDback to summary
private static final int OFFSET_ESCAPEMENT_TYPE_MODIFIED
OFFSET_FONT_COLOR_INDEXback to summary
private static final int OFFSET_FONT_COLOR_INDEX
OFFSET_FONT_FORMATING_ENDback to summary
private static final int OFFSET_FONT_FORMATING_END
OFFSET_FONT_HEIGHTback to summary
private static final int OFFSET_FONT_HEIGHT
OFFSET_FONT_NAMEback to summary
private static final int OFFSET_FONT_NAME
OFFSET_FONT_OPTIONSback to summary
private static final int OFFSET_FONT_OPTIONS
OFFSET_FONT_WEIGHTback to summary
private static final int OFFSET_FONT_WEIGHT
OFFSET_FONT_WEIGHT_MODIFIEDback to summary
private static final int OFFSET_FONT_WEIGHT_MODIFIED
OFFSET_NOT_USED1back to summary
private static final int OFFSET_NOT_USED1
OFFSET_NOT_USED2back to summary
private static final int OFFSET_NOT_USED2
OFFSET_NOT_USED3back to summary
private static final int OFFSET_NOT_USED3
OFFSET_OPTION_FLAGSback to summary
private static final int OFFSET_OPTION_FLAGS
OFFSET_UNDERLINE_TYPEback to summary
private static final int OFFSET_UNDERLINE_TYPE
OFFSET_UNDERLINE_TYPE_MODIFIEDback to summary
private static final int OFFSET_UNDERLINE_TYPE_MODIFIED
OUTLINEback to summary
private static final BitField OUTLINE
POSTUREback to summary
private static final BitField POSTURE
RAW_DATA_SIZEback to summary
private static final int RAW_DATA_SIZE
SHADOWback to summary
private static final BitField SHADOW

Constructor Detail

FontFormattingback to summary
public FontFormatting()
FontFormattingback to summary
public FontFormatting(FontFormatting other)
FontFormattingback to summary
public FontFormatting(RecordInputStream in)

Method Detail

copyback to summary
public FontFormatting copy()

Implements org.apache.poi.common.Duplicatable.copy.

Returns:FontFormatting

Doc from org.apache.poi.common.Duplicatable.copy.

a deep copy of the implementing class / instance

Annotations
@Override
getDataLengthback to summary
public int getDataLength()
getEscapementTypeback to summary
public short getEscapementType()

get the type of super or subscript for the font

Returns:short

super or subscript option

See Also
org.apache.poi.ss.usermodel.Font#SS_NONE, org.apache.poi.ss.usermodel.Font#SS_SUPER, org.apache.poi.ss.usermodel.Font#SS_SUB
getFontColorIndexback to summary
public short getFontColorIndex()
getFontHeightback to summary
public int getFontHeight()

gets the height of the font in 1/20th point units

Returns:int

fontheight (in points/20); or -1 if not modified

getFontOptionback to summary
private boolean getFontOption(BitField field)
getFontWeightback to summary
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:short

bw - a number between 100-1000 for the fonts "boldness"

getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

Implements org.apache.poi.common.usermodel.GenericRecord.getGenericProperties.

Annotations
@Override
getIntback to summary
private int getInt(int offset)
getOptionFlagback to summary
private boolean getOptionFlag(BitField field)
getRawRecordback to summary
public byte[] getRawRecord()
getShortback to summary
private short getShort(int offset)
getUnderlineTypeback to summary
public short getUnderlineType()

get the type of underlining for the font

Returns:short

font underlining type

See Also
org.apache.poi.ss.usermodel.Font#U_NONE, org.apache.poi.ss.usermodel.Font#U_SINGLE, org.apache.poi.ss.usermodel.Font#U_DOUBLE, org.apache.poi.ss.usermodel.Font#U_SINGLE_ACCOUNTING, org.apache.poi.ss.usermodel.Font#U_DOUBLE_ACCOUNTING
isBoldback to summary
public boolean isBold()

get whether the font weight is set to bold or not

Returns:boolean

bold - whether the font is bold or not

isEscapementTypeModifiedback to summary
public boolean isEscapementTypeModified()
isFontCancellationModifiedback to summary
public boolean isFontCancellationModified()
isFontOutlineModifiedback to summary
public boolean isFontOutlineModified()
isFontShadowModifiedback to summary
public boolean isFontShadowModified()
isFontStyleModifiedback to summary
public boolean isFontStyleModified()
isFontWeightModifiedback to summary
public boolean isFontWeightModified()
isItalicback to summary
public boolean isItalic()

get whether the font is to be italics or not

Returns:boolean

italics - whether the font is italics or not

See Also
getFontOption(org.apache.poi.util.BitField)
isOutlineOnback to summary
public boolean isOutlineOn()
isShadowOnback to summary
public boolean isShadowOn()
isStruckoutback to summary
public boolean isStruckout()

get whether the font is to be stricken out or not

Returns:boolean

strike - whether the font is stricken out or not

See Also
getFontOption(org.apache.poi.util.BitField)
isUnderlineTypeModifiedback to summary
public boolean isUnderlineTypeModified()
setBoldback to summary
public void setBold(boolean bold)

set the font weight to bold (weight=700) or to normal(weight=400) boldness.

Parameters
bold:boolean

- set font weight to bold if true; to normal otherwise

setEscapementTypeback to summary
public void setEscapementType(short escapementType)

set the escapement type for the font

Parameters
escapementType:short

super or subscript option

See Also
org.apache.poi.ss.usermodel.Font#SS_NONE, org.apache.poi.ss.usermodel.Font#SS_SUPER, org.apache.poi.ss.usermodel.Font#SS_SUB
setEscapementTypeModifiedback to summary
public void setEscapementTypeModified(boolean modified)
setFontCancellationModifiedback to summary
public void setFontCancellationModified(boolean modified)
setFontColorIndexback to summary
public void setFontColorIndex(short fci)
setFontHeightback to summary
public void setFontHeight(int height)

sets the height of the font in 1/20th point units

Parameters
height:int

fontheight (in points/20); or -1 to preserve the cell font height

setFontOptionback to summary
private void setFontOption(boolean option, BitField field)
setFontOutlineModifiedback to summary
public void setFontOutlineModified(boolean modified)
setFontShadowModifiedback to summary
public void setFontShadowModified(boolean modified)
setFontStyleModifiedback to summary
public void setFontStyleModified(boolean modified)
setFontWeightback to summary
private void setFontWeight(short bw)

set the font weight (100-1000dec or 0x64-0x3e8). Default is 0x190 for normal and 0x2bc for bold

Parameters
bw:short

- a number between 100-1000 for the fonts "boldness"

setFontWieghtModifiedback to summary
public void setFontWieghtModified(boolean modified)
setIntback to summary
private void setInt(int offset, int value)
setItalicback to summary
public void setItalic(boolean italic)

set the font to be italics or not

Parameters
italic:boolean

- whether the font is italics or not

See Also
setFontOption(boolean, org.apache.poi.util.BitField)
setOptionFlagback to summary
private void setOptionFlag(boolean modified, BitField field)
setOutlineback to summary
public void setOutline(boolean on)
setShadowback to summary
public void setShadow(boolean on)
setShortback to summary
private void setShort(int offset, int value)
setStrikeoutback to summary
public void setStrikeout(boolean strike)

set the font to be stricken out or not

Parameters
strike:boolean

- whether the font is stricken out or not

setUnderlineTypeback to summary
public void setUnderlineType(short underlineType)

set the type of underlining type for the font

Parameters
underlineType:short

underline option

See Also
org.apache.poi.ss.usermodel.Font#U_NONE, org.apache.poi.ss.usermodel.Font#U_SINGLE, org.apache.poi.ss.usermodel.Font#U_DOUBLE, org.apache.poi.ss.usermodel.Font#U_SINGLE_ACCOUNTING, org.apache.poi.ss.usermodel.Font#U_DOUBLE_ACCOUNTING
setUnderlineTypeModifiedback to summary
public void setUnderlineTypeModified(boolean modified)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object