Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FONT_ARIAL
Arial font
(宋体字体)
|
ANSI_CHARSET, COLOR_NORMAL, COLOR_RED, DEFAULT_CHARSET, SS_NONE, SS_SUB, SS_SUPER, SYMBOL_CHARSET, TWIPS_PER_POINT, U_DOUBLE, U_DOUBLE_ACCOUNTING, U_NONE, U_SINGLE, U_SINGLE_ACCOUNTING
Modifier | Constructor and Description |
---|---|
protected |
HSSFFont(int index, FontRecord rec)
Creates a new instance of HSSFFont
(创建 HSSFFont 的新实例)
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
boolean |
getBold()
get if the font is bold or not
(获取字体是否为粗体)
|
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
(获取字体高度)
|
java.lang.String |
getFontName()
get the name for the font (i.e.
(获取字体的名称(即)
|
HSSFColor |
getHSSFColor(HSSFWorkbook wb)
get the color value for the font
(获取字体的颜色值)
|
int |
getIndex()
get the index within the XSSFWorkbook (sequence within the collection of Font objects)
(获取 XSSFWorkbook 中的索引(Font 对象集合中的序列))
|
int |
getIndexAsInt()
Deprecated.
(已弃用。)
|
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
(获取要使用的下划线文本类型)
|
int |
hashCode() |
void |
setBold(boolean bold)
sets the font to be bold or not
(设置字体是否为粗体)
|
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
(设置要使用的文本下划线类型)
|
java.lang.String |
toString() |
public static final java.lang.String FONT_ARIAL
protected HSSFFont(int index, FontRecord rec)
public void setFontName(java.lang.String name)
setFontName
in interface
Font
(接口 Font 中的 setFontName)
name
- String representing the name of the font to use
(name - 表示要使用的字体名称的字符串)
FONT_ARIAL
public java.lang.String getFontName()
getFontName
in interface
Font
(接口 Font 中的 getFontName)
FONT_ARIAL
public int getIndex()
Font
@Deprecated @Removal(version="6.0.0") public int getIndexAsInt()
Font
getIndexAsInt
in interface
Font
(接口字体中的getIndexAsInt)
public void setFontHeight(short height)
setFontHeight
in interface
Font
(接口 Font 中的 setFontHeight)
height
- height in 1/20ths of a point
(height - 1/20 点的高度)
setFontHeightInPoints(short)
public void setFontHeightInPoints(short height)
setFontHeightInPoints
in interface
Font
(接口 Font 中的 setFontHeightInPoints)
height
- height in the familiar unit of measure - points
(height - 以熟悉的测量单位表示的高度 - 点)
setFontHeight(short)
public short getFontHeight()
getFontHeight
in interface
Font
(接口 Font 中的 getFontHeight)
getFontHeightInPoints()
public short getFontHeightInPoints()
getFontHeightInPoints
in interface
Font
(接口 Font 中的 getFontHeightInPoints)
getFontHeight()
public void setItalic(boolean italic)
public boolean getItalic()
public void setStrikeout(boolean strikeout)
setStrikeout
in interface
Font
(界面字体中的 setStrikeout)
strikeout
- or not
(三振 - 与否)
public boolean getStrikeout()
getStrikeout
in interface
Font
(界面字体中的getStrikeout)
public void setColor(short color)
setColor
in interface
Font
(界面字体中的setColor)
color
- to use
(颜色 - 使用)
Note: Use this rather than HSSFColor.AUTOMATIC for default font color
,
Font.COLOR_RED
public short getColor()
getColor
in interface
Font
(界面字体中的getColor)
Font.COLOR_NORMAL
,
Font.COLOR_RED
,
HSSFPalette.getColor(short)
public HSSFColor getHSSFColor(HSSFWorkbook wb)
public void setBold(boolean bold)
public boolean getBold()
public void setTypeOffset(short offset)
setTypeOffset
in interface
Font
(接口 Font 中的 setTypeOffset)
offset
- type to use (none,super,sub)
(offset - 要使用的类型 (none,super,sub))
Font.SS_NONE
,
Font.SS_SUPER
,
Font.SS_SUB
public short getTypeOffset()
getTypeOffset
in interface
Font
(接口 Font 中的 getTypeOffset)
Font.SS_NONE
,
Font.SS_SUPER
,
Font.SS_SUB
public void setUnderline(byte underline)
setUnderline
in interface
Font
(界面字体中的setUnderline)
underline
- type
(下划线 - 类型)
Font.U_NONE
,
Font.U_SINGLE
,
Font.U_DOUBLE
,
Font.U_SINGLE_ACCOUNTING
,
Font.U_DOUBLE_ACCOUNTING
public byte getUnderline()
getUnderline
in interface
Font
(界面字体中的getUnderline)
Font.U_NONE
,
Font.U_SINGLE
,
Font.U_DOUBLE
,
Font.U_SINGLE_ACCOUNTING
,
Font.U_DOUBLE_ACCOUNTING
public int getCharSet()
getCharSet
in interface
Font
(接口 Font 中的 getCharSet)
Font.ANSI_CHARSET
,
Font.DEFAULT_CHARSET
,
Font.SYMBOL_CHARSET
public void setCharSet(int charset)
setCharSet
in interface
Font
(接口 Font 中的 setCharSet)
Font.ANSI_CHARSET
,
Font.DEFAULT_CHARSET
,
Font.SYMBOL_CHARSET
public void setCharSet(byte charset)
setCharSet
in interface
Font
(接口 Font 中的 setCharSet)
Font.ANSI_CHARSET
,
Font.DEFAULT_CHARSET
,
Font.SYMBOL_CHARSET
public java.lang.String toString()
toString
in class
java.lang.Object
public int hashCode()
hashCode
in class
java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class
java.lang.Object
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.