Modifier and Type | Field and Description |
---|---|
static byte |
ANSI_CHARSET
ANSI character set
(ANSI 字符集)
|
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.
(字体高度以点和 1/20 点为单位处理,因此这是用于在这两个单位之间进行转换的常数。)
|
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.
(以点的 1/20 为单位获取字体高度。)
|
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)
(获取 XSSFWorkbook 中的索引(Font 对象集合中的序列))
|
int |
getIndexAsInt()
|
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.
(以点的 1/20 为单位设置字体高度。)
|
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 use
(name - 表示要使用的字体名称的字符串)
java.lang.String getFontName()
void setFontHeight(short height)
height
- height in 1/20ths of a point
(height - 1/20 点的高度)
setFontHeightInPoints(short)
void setFontHeightInPoints(short height)
height
- height in the familiar unit of measure - points
(height - 以熟悉的测量单位表示的高度 - 点)
setFontHeight(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.
(获取以磅为单位的字体高度。这将返回与 Excel 中显示的相同的字体高度,例如 10 或 14 或 28。)getFontHeight()
void setItalic(boolean italic)
italic
- italics or not
(斜体 - 斜体与否)
boolean getItalic()
void setStrikeout(boolean strikeout)
strikeout
- or not
(三振 - 与否)
boolean getStrikeout()
void setColor(short color)
color
- to use
(颜色 - 使用)
Note: 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
- type
(下划线 - 类型)
U_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()
instead
void setBold(boolean bold)
boolean getBold()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.