Package loci.poi.hssf.usermodel
Class HSSFFont
java.lang.Object
loci.poi.hssf.usermodel.HSSFFont
Represents a Font used in a workbook.
- Version:
- 1.0-pre
- Author:
- Andrew C. Oliver
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteANSI character setstatic final shortBold boldness (bold)static final shortNormal boldness (not bold)static final shortnormal type of black color.static final shortDark Red colorstatic final byteDefault character set.static final StringArial fontstatic final shortno type offsetting (not super or subscript)static final shortsubscriptstatic final shortsuperscriptstatic final byteSymbol character setstatic final bytedouble underlinedstatic final byteaccounting style double underlinestatic final bytenot underlinedstatic final bytesingle (normal) underlinestatic final byteaccounting style single underline -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHSSFFont(short index, FontRecord rec) Creates a new instance of HSSFFont -
Method Summary
Modifier and TypeMethodDescriptionshortget the boldness to usebyteget character-set to use.shortgetColor()get the color for the fontshortget the font height in unit's of 1/20th of a point.shortget the font heightget the name for the font (i.e.shortgetIndex()get the index within the HSSFWorkbook (sequence within the collection of Font objects)booleanget whether to use italics or notbooleanget whether to use a strikeout horizontal line through the text or notshortget normal,super or subscript.byteget type of text underlining to usevoidsetBoldweight(short boldweight) set the boldness to usevoidsetCharSet(byte charset) set character-set to use.voidsetColor(short color) set the color for the fontvoidsetFontHeight(short height) set the font height in unit's of 1/20th of a point.voidsetFontHeightInPoints(short height) set the font heightvoidsetFontName(String name) set the name for the font (i.e.voidsetItalic(boolean italic) set whether to use italics or notvoidsetStrikeout(boolean strikeout) set whether to use a strikeout horizontal line through the text or notvoidsetTypeOffset(short offset) set normal,super or subscript.voidsetUnderline(byte underline) set type of text underlining to usetoString()
-
Field Details
-
FONT_ARIAL
Arial font- See Also:
-
BOLDWEIGHT_NORMAL
public static final short BOLDWEIGHT_NORMALNormal boldness (not bold)- See Also:
-
BOLDWEIGHT_BOLD
public static final short BOLDWEIGHT_BOLDBold boldness (bold)- See Also:
-
COLOR_NORMAL
public static final short COLOR_NORMALnormal type of black color.- See Also:
-
COLOR_RED
public static final short COLOR_REDDark Red color- See Also:
-
SS_NONE
public static final short SS_NONEno type offsetting (not super or subscript)- See Also:
-
SS_SUPER
public static final short SS_SUPERsuperscript- See Also:
-
SS_SUB
public static final short SS_SUBsubscript- See Also:
-
U_NONE
public static final byte U_NONEnot underlined- See Also:
-
U_SINGLE
public static final byte U_SINGLEsingle (normal) underline- See Also:
-
U_DOUBLE
public static final byte U_DOUBLEdouble underlined- See Also:
-
U_SINGLE_ACCOUNTING
public static final byte U_SINGLE_ACCOUNTINGaccounting style single underline- See Also:
-
U_DOUBLE_ACCOUNTING
public static final byte U_DOUBLE_ACCOUNTINGaccounting style double underline- See Also:
-
ANSI_CHARSET
public static final byte ANSI_CHARSETANSI character set- See Also:
-
DEFAULT_CHARSET
public static final byte DEFAULT_CHARSETDefault character set.- See Also:
-
SYMBOL_CHARSET
public static final byte SYMBOL_CHARSETSymbol character set- See Also:
-
-
Constructor Details
-
HSSFFont
Creates a new instance of HSSFFont
-
-
Method Details
-
setFontName
set the name for the font (i.e. Arial)- Parameters:
name- String representing the name of the font to use- See Also:
-
getFontName
get the name for the font (i.e. Arial)- Returns:
- String representing the name of the font to use
- See Also:
-
getIndex
public short getIndex()get the index within the HSSFWorkbook (sequence within the collection of Font objects)- Returns:
- unique index number of the underlying record this Font represents (probably you don't care unless you're comparing which one is which)
-
setFontHeight
public void setFontHeight(short height) set the font height in unit's of 1/20th of a point. Maybe you might want to use the setFontHeightInPoints which matches to the familiar 10, 12, 14 etc..- Parameters:
height- height in 1/20ths of a point- See Also:
-
setFontHeightInPoints
public void setFontHeightInPoints(short height) set the font height- Parameters:
height- height in the familiar unit of measure - points- See Also:
-
getFontHeight
public short getFontHeight()get the font height in unit's of 1/20th of a point. Maybe you might want to use the getFontHeightInPoints which matches to the familiar 10, 12, 14 etc..- Returns:
- short - height in 1/20ths of a point
- See Also:
-
getFontHeightInPoints
public short getFontHeightInPoints()get the font height- Returns:
- short - height in the familiar unit of measure - points
- See Also:
-
setItalic
public void setItalic(boolean italic) set whether to use italics or not- Parameters:
italic- italics or not
-
getItalic
public boolean getItalic()get whether to use italics or not- Returns:
- italics or not
-
setStrikeout
public void setStrikeout(boolean strikeout) set whether to use a strikeout horizontal line through the text or not- Parameters:
strikeout- or not
-
getStrikeout
public boolean getStrikeout()get whether to use a strikeout horizontal line through the text or not- Returns:
- strikeout or not
-
setColor
public void setColor(short color) set the color for the font- Parameters:
color- to use- See Also:
-
getColor
public short getColor()get the color for the font- Returns:
- color to use
- See Also:
-
setBoldweight
public void setBoldweight(short boldweight) set the boldness to use- Parameters:
boldweight-- See Also:
-
getBoldweight
public short getBoldweight()get the boldness to use- Returns:
- boldweight
- See Also:
-
setTypeOffset
public void setTypeOffset(short offset) set normal,super or subscript. -
getTypeOffset
public short getTypeOffset()get normal,super or subscript. -
setUnderline
public void setUnderline(byte underline) set type of text underlining to use- Parameters:
underline- type- See Also:
-
getUnderline
public byte getUnderline()get type of text underlining to use- Returns:
- underlining type
- See Also:
-
getCharSet
public byte getCharSet()get character-set to use.- Returns:
- character-set
- See Also:
-
setCharSet
public void setCharSet(byte charset) set character-set to use.- See Also:
-
toString
-