Modifier and Type | Field and Description |
---|---|
static byte |
ANSI_CHARSET
ANSI character set
|
static short |
COLOR_NORMAL
normal type of black color.
|
static short |
COLOR_RED
Dark Red color
|
static byte |
DEFAULT_CHARSET
Default character set.
|
static short |
SS_NONE
no type offsetting (not super or subscript)
|
static short |
SS_SUB
subscript
|
static short |
SS_SUPER
superscript
|
static byte |
SYMBOL_CHARSET
Symbol character set
|
static int |
TWIPS_PER_POINT
Font height is handled in points and 1/20th of points so
this is the constant used to convert between those two units.
|
static byte |
U_DOUBLE
double underlined
|
static byte |
U_DOUBLE_ACCOUNTING
accounting style double underline
|
static byte |
U_NONE
not underlined
|
static byte |
U_SINGLE
single (normal) underline
|
static byte |
U_SINGLE_ACCOUNTING
accounting style single underline
|
Modifier and Type | Method and Description |
---|---|
boolean |
getBold() |
int |
getCharSet()
get character-set to use.
|
short |
getColor()
get the color for the font
|
short |
getFontHeight()
Get the font height in unit's of 1/20th of a point.
|
short |
getFontHeightInPoints()
Get the font height in points.
|
java.lang.String |
getFontName()
get the name for the font (i.e.
|
int |
getIndex()
get the index within the XSSFWorkbook (sequence within the collection of Font objects)
|
int |
getIndexAsInt()
Deprecated.
use
getIndex() instead |
boolean |
getItalic()
get whether to use italics or not
|
boolean |
getStrikeout()
get whether to use a strikeout horizontal line through the text or not
|
short |
getTypeOffset()
get normal,super or subscript.
|
byte |
getUnderline()
get type of text underlining to use
|
void |
setBold(boolean bold) |
void |
setCharSet(byte charset)
set character-set to use.
|
void |
setCharSet(int charset)
set character-set to use.
|
void |
setColor(short color)
set the color for the font
|
void |
setFontHeight(short height)
set the font height in unit's of 1/20th of a point.
|
void |
setFontHeightInPoints(short height)
set the font height
|
void |
setFontName(java.lang.String name)
set the name for the font (i.e.
|
void |
setItalic(boolean italic)
set whether to use italics or not
|
void |
setStrikeout(boolean strikeout)
set whether to use a strikeout horizontal line through the text or not
|
void |
setTypeOffset(short offset)
set normal,super or subscript.
|
void |
setUnderline(byte underline)
set type of text underlining to use
|
static final short COLOR_NORMAL
static final short COLOR_RED
static final short SS_NONE
static final short SS_SUPER
static final short SS_SUB
static final byte U_NONE
static final byte U_SINGLE
static final byte U_DOUBLE
static final byte U_SINGLE_ACCOUNTING
static final byte U_DOUBLE_ACCOUNTING
static final byte ANSI_CHARSET
static final byte DEFAULT_CHARSET
static final byte SYMBOL_CHARSET
static final int TWIPS_PER_POINT
void setFontName(java.lang.String name)
name
- String representing the name of the font to usejava.lang.String getFontName()
void setFontHeight(short height)
height
- height in 1/20ths of a pointsetFontHeightInPoints(short)
void setFontHeightInPoints(short height)
height
- height in the familiar unit of measure - pointssetFontHeight(short)
short getFontHeight()
For many users, the related getFontHeightInPoints()
will be more helpful, as that returns font heights in the
more familiar points units, eg 10, 12, 14.
getFontHeightInPoints()
short getFontHeightInPoints()
This will return the same font height that is shown in Excel, such as 10 or 14 or 28.
getFontHeight()
void setItalic(boolean italic)
italic
- italics or notboolean getItalic()
void setStrikeout(boolean strikeout)
strikeout
- or notboolean getStrikeout()
void setColor(short color)
color
- to useNote: Use this rather than HSSFColor.AUTOMATIC for default font color
,
COLOR_RED
short getColor()
COLOR_NORMAL
,
COLOR_RED
,
HSSFPalette.getColor(short)
void setTypeOffset(short offset)
short getTypeOffset()
void setUnderline(byte underline)
underline
- typeU_NONE
,
U_SINGLE
,
U_DOUBLE
,
U_SINGLE_ACCOUNTING
,
U_DOUBLE_ACCOUNTING
byte getUnderline()
U_NONE
,
U_SINGLE
,
U_DOUBLE
,
U_SINGLE_ACCOUNTING
,
U_DOUBLE_ACCOUNTING
int getCharSet()
ANSI_CHARSET
,
DEFAULT_CHARSET
,
SYMBOL_CHARSET
void setCharSet(byte charset)
ANSI_CHARSET
,
DEFAULT_CHARSET
,
SYMBOL_CHARSET
void setCharSet(int charset)
ANSI_CHARSET
,
DEFAULT_CHARSET
,
SYMBOL_CHARSET
int getIndex()
@Deprecated @Removal(version="6.0.0") int getIndexAsInt()
getIndex()
insteadvoid setBold(boolean bold)
boolean getBold()
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.