Modifier and Type | Field and Description |
---|---|
static short |
DEFAULT_FONT_COLOR
Default font color is black
(默认字体颜色为黑色)
|
static java.lang.String |
DEFAULT_FONT_NAME
By default, Microsoft Office Excel 2007 uses the Calibri font in font size 11
(默认情况下,Microsoft Office Excel 2007 使用字体大小为 11 的 Calibri 字体)
|
static short |
DEFAULT_FONT_SIZE
By default, Microsoft Office Excel 2007 uses the Calibri font in font size 11
(默认情况下,Microsoft Office Excel 2007 使用字体大小为 11 的 Calibri 字体)
|
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
Constructor and Description |
---|
XSSFFont()
Create a new XSSFont.
|
XSSFFont(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont font)
Create a new XSSFFont
|
XSSFFont(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont font, int index, IndexedColorMap colorMap)
Called from parsing styles.xml
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
boolean |
getBold()
get a boolean value for the boldness to use.
(获取要使用的粗度的布尔值。)
|
int |
getCharSet()
get character-set to use.
(获取要使用的字符集。)
|
short |
getColor()
get the indexed color value for the font References a color defined in IndexedColors.
(获取字体的索引颜色值 引用在 IndexedColors 中定义的颜色。)
|
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont |
getCTFont()
get the underlying CTFont font
(获取底层 CTFont 字体)
|
int |
getFamily()
get the font family to use.
(获取要使用的字体系列。)
|
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 of the font (i.e.
(获取字体的名称(即)
|
int |
getIndex()
get the index within the XSSFWorkbook (sequence within the collection of Font objects)
(获取 XSSFWorkbook 中的索引(Font 对象集合中的序列))
|
int |
getIndexAsInt()
Deprecated.
(已弃用。)
|
boolean |
getItalic()
get a boolean value that specify whether to use italics or not
(获取一个布尔值,指定是否使用斜体)
|
FontScheme |
getScheme()
get the font scheme property.
(获取字体方案属性。)
|
boolean |
getStrikeout()
get a boolean value that specify whether to use a strikeout horizontal line through the text or not
(获取一个布尔值,指定是否在文本中使用删除线水平线)
|
short |
getThemeColor()
get the color value for the font References a color defined in theme.
(获取字体的颜色值 引用主题中定义的颜色。)
|
short |
getTypeOffset()
get normal,super or subscript.
(获取普通、上标或下标。)
|
byte |
getUnderline()
get type of text underlining to use
(获取要使用的下划线文本类型)
|
XSSFColor |
getXSSFColor()
get the color value for the font References a color defined as Standard Alpha Red Green Blue color value (ARGB).
(获取字体的颜色值 引用定义为标准 Alpha 红绿蓝颜色值 (ARGB) 的颜色。)
|
int |
hashCode() |
long |
registerTo(StylesTable styles)
Perform a registration of ourselves to the style table
(将我们自己注册到样式表)
|
long |
registerTo(StylesTable styles, boolean force) |
void |
setBold(boolean bold)
set a boolean value for the boldness to use.
(为要使用的粗体设置一个布尔值。)
|
void |
setCharSet(byte charset)
set character-set to use.
(设置要使用的字符集。)
|
void |
setCharSet(FontCharset charSet)
|
void |
setCharSet(FontCharset charSet)
set character-set to use.
(设置要使用的字符集。)
|
void |
setCharSet(int charset)
set character-set to use.
(设置要使用的字符集。)
|
void |
setColor(short color)
set the indexed color for the font
(设置字体的索引颜色)
|
void |
setColor(XSSFColor color)
set the color for the font in Standard Alpha Red Green Blue color value
(在标准 Alpha 红色 绿色 蓝色 颜色值中设置字体颜色)
|
void |
setFamily(FontFamily family)
set an enumeration representing the font family this font belongs to.
(设置一个表示该字体所属字体系列的枚举。)
|
void |
setFamily(int value)
Set the font family this font belongs to.
(设置该字体所属的字体系列。)
|
void |
setFontHeight(double height)
set the font height in points.
(以磅为单位设置字体高度。)
|
void |
setFontHeight(short height)
set the font height in points.
(以磅为单位设置字体高度。)
|
void |
setFontHeightInPoints(short height)
set the font height in points.
(以磅为单位设置字体高度。)
|
void |
setFontName(java.lang.String name)
set the name for the font (i.e.
(设置字体的名称(即)
|
void |
setItalic(boolean italic)
set a boolean value for the property specifying whether to use italics or not If omitted, the default value is true.
(为指定是否使用斜体的属性设置一个布尔值 如果省略,则默认值为 true。)
|
void |
setScheme(FontScheme scheme)
set font scheme property
(设置字体方案属性)
|
void |
setStrikeout(boolean strikeout)
set a boolean value for the property specifying whether to use a strikeout horizontal line through the text or not If omitted, the default value is true.
(为属性设置一个布尔值,指定是否在文本中使用删除线水平线如果省略,则默认值为 true。)
|
void |
setThemeColor(short theme)
set the theme color for the font to use
(设置要使用的字体的主题颜色)
|
void |
setThemesTable(ThemesTable themes)
Records the Themes Table that is associated with the current font, used when looking up theme based colours and properties.
(记录与当前字体关联的主题表,在查找基于主题的颜色和属性时使用。)
|
void |
setTypeOffset(short offset)
set normal,super or subscript, that representing the vertical-alignment setting.
(设置法线、上标或下标,表示垂直对齐设置。)
|
void |
setUnderline(byte underline)
set the style of underlining that is used.
(设置使用的下划线样式。)
|
void |
setUnderline(FontUnderline underline)
set an enumeration representing the style of underlining that is used.
(设置一个表示使用的下划线样式的枚举。)
|
java.lang.String |
toString() |
public static final java.lang.String DEFAULT_FONT_NAME
public static final short DEFAULT_FONT_SIZE
public static final short DEFAULT_FONT_COLOR
IndexedColors.BLACK
@Internal public XSSFFont(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont font)
font
- the underlying CTFont bean
(font - 底层 CTFont bean)
@Internal public XSSFFont(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont font, int index, IndexedColorMap colorMap)
font
- CTFont
(字体-CTFont)
index
- font index
(index - 字体索引)
colorMap
- for default or custom indexed colors
(colorMap - 用于默认或自定义索引颜色)
public XSSFFont()
@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont getCTFont()
public boolean getBold()
public int getCharSet()
getCharSet
in interface
Font
(接口 Font 中的 getCharSet)
FontCharset
public short getColor()
getColor
in interface
Font
(界面字体中的getColor)
IndexedColors
public XSSFColor getXSSFColor()
public short getThemeColor()
public 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.
getFontHeight
in interface
Font
(接口 Font 中的 getFontHeight)
getFontHeightInPoints()
public 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。)getFontHeightInPoints
in interface
Font
(接口 Font 中的 getFontHeightInPoints)
getFontHeight()
public java.lang.String getFontName()
getFontName
in interface
Font
(接口 Font 中的 getFontName)
public boolean getItalic()
public boolean getStrikeout()
getStrikeout
in interface
Font
(界面字体中的getStrikeout)
public short getTypeOffset()
getTypeOffset
in interface
Font
(接口 Font 中的 getTypeOffset)
Font.SS_NONE
,
Font.SS_SUPER
,
Font.SS_SUB
public byte getUnderline()
getUnderline
in interface
Font
(界面字体中的getUnderline)
FontUnderline
public void setBold(boolean bold)
public void setCharSet(byte charset)
setCharSet
in interface
Font
(接口 Font 中的 setCharSet)
charset
- - charset
(字符集 - - 字符集)
FontCharset
public void setCharSet(int charset)
setCharSet
in interface
Font
(接口 Font 中的 setCharSet)
charset
- - charset
(字符集 - - 字符集)
FontCharset
@Deprecated @Removal(version="6.0.0") public void setCharSet(FontCharset charSet)
setCharSet(FontCharset)
instead
charSet
-
(字符集 -)
public void setCharSet(FontCharset charSet)
charSet
-
(字符集 -)
public void setColor(short color)
setColor
in interface
Font
(界面字体中的setColor)
color
- - color to use
(color - - 使用的颜色)
- Note: default font color
,
IndexedColors
public void setColor(XSSFColor color)
color
- - color to use
(color - - 使用的颜色)
public void setFontHeight(short height)
setFontHeight
in interface
Font
(接口 Font 中的 setFontHeight)
height
- - height in points
(height - - 以点为单位的高度)
Font.setFontHeightInPoints(short)
public void setFontHeight(double height)
height
- - height in points
(height - - 以点为单位的高度)
public void setFontHeightInPoints(short height)
setFontHeightInPoints
in interface
Font
(接口 Font 中的 setFontHeightInPoints)
height
- height in the familiar unit of measure - points
(height - 以熟悉的测量单位表示的高度 - 点)
setFontHeight(short)
public void setThemeColor(short theme)
theme
- - theme color to use
(主题 - - 使用的主题颜色)
public void setFontName(java.lang.String name)
setFontName
in interface
Font
(接口 Font 中的 setFontName)
name
- - value representing the name of the font to use
(name - 表示要使用的字体名称的值)
DEFAULT_FONT_NAME
public void setItalic(boolean italic)
public void setStrikeout(boolean strikeout)
setStrikeout
in interface
Font
(界面字体中的 setStrikeout)
strikeout
- - value for strikeout or not
(三振 - - 三振值与否)
public void setTypeOffset(short offset)
setTypeOffset
in interface
Font
(接口 Font 中的 setTypeOffset)
offset
- - offset type to use (none,super,sub)
(offset - - 要使用的偏移类型 (none,super,sub))
Font.SS_NONE
,
Font.SS_SUPER
,
Font.SS_SUB
public void setUnderline(byte underline)
setUnderline
in interface
Font
(界面字体中的setUnderline)
underline
- - underline type to use
(underline - - 要使用的下划线类型)
FontUnderline
public void setUnderline(FontUnderline underline)
underline
- - FontUnderline enum value
(下划线 - - FontUnderline 枚举值)
public java.lang.String toString()
toString
in class
java.lang.Object
public long registerTo(StylesTable styles)
public long registerTo(StylesTable styles, boolean force)
public void setThemesTable(ThemesTable themes)
public FontScheme getScheme()
StylesTable.createDefaultFont()
public void setScheme(FontScheme scheme)
scheme
- - FontScheme enum value
(scheme - - FontScheme 枚举值)
FontScheme
public int getFamily()
FontFamily
public void setFamily(int value)
value
- - font family
(值 - - 字体系列)
FontFamily
public void setFamily(FontFamily family)
family
- font family
(家族 - 字体家族)
setFamily(int value)
public int getIndex()
Font
@Deprecated @Removal(version="6.0.0") public int getIndexAsInt()
Font
getIndexAsInt
in interface
Font
(接口字体中的getIndexAsInt)
public int hashCode()
hashCode
in class
java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class
java.lang.Object
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.