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
|
static short |
DEFAULT_FONT_SIZE
By default, Microsoft Office Excel 2007 uses the Calibri font in font size 11
|
ANSI_CHARSET, COLOR_NORMAL, COLOR_RED, DEFAULT_CHARSET, SS_NONE, SS_SUB, SS_SUPER, SYMBOL_CHARSET, 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.
|
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont |
getCTFont()
get the underlying CTFont font
|
int |
getFamily()
get the font family to use.
|
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 of the font (i.e.
|
short |
getIndex()
Deprecated.
|
int |
getIndexAsInt()
get the index within the XSSFWorkbook (sequence within the collection of Font objects)
|
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).
|
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)
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
|
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.
|
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.
|
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@Internal public XSSFFont(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont font, int index, IndexedColorMap colorMap)
font
- CTFontindex
- font indexcolorMap
- for default or custom indexed colorspublic XSSFFont()
@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont getCTFont()
public boolean getBold()
public int getCharSet()
getCharSet
in interface Font
FontCharset
public short getColor()
getColor
in interface Font
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
getFontHeightInPoints()
public short getFontHeightInPoints()
This will return the same font height that is shown in Excel, such as 10 or 14 or 28.
getFontHeightInPoints
in interface Font
getFontHeight()
public java.lang.String getFontName()
getFontName
in interface Font
public boolean getItalic()
public boolean getStrikeout()
getStrikeout
in interface Font
public short getTypeOffset()
getTypeOffset
in interface Font
Font.SS_NONE
,
Font.SS_SUPER
,
Font.SS_SUB
public byte getUnderline()
getUnderline
in interface Font
FontUnderline
public void setBold(boolean bold)
public void setCharSet(byte charset)
setCharSet
in interface Font
charset
- - charsetFontCharset
public void setCharSet(int charset)
setCharSet
in interface Font
charset
- - charsetFontCharset
public void setCharSet(FontCharset charSet)
charSet
- public void setColor(short color)
setColor
in interface Font
color
- - color to use- Note: default font color
,
IndexedColors
public void setColor(XSSFColor color)
color
- - color to usepublic void setFontHeight(short height)
setFontHeight
in interface Font
height
- - height in pointsFont.setFontHeightInPoints(short)
public void setFontHeight(double height)
height
- - height in pointspublic void setFontHeightInPoints(short height)
setFontHeightInPoints
in interface Font
height
- height in the familiar unit of measure - pointssetFontHeight(short)
public void setThemeColor(short theme)
theme
- - theme color to usepublic void setFontName(java.lang.String name)
setFontName
in interface Font
name
- - value representing the name of the font to useDEFAULT_FONT_NAME
public void setItalic(boolean italic)
public void setStrikeout(boolean strikeout)
setStrikeout
in interface Font
strikeout
- - value for strikeout or notpublic void setTypeOffset(short offset)
setTypeOffset
in interface Font
offset
- - offset type to use (none,super,sub)Font.SS_NONE
,
Font.SS_SUPER
,
Font.SS_SUB
public void setUnderline(byte underline)
setUnderline
in interface Font
underline
- - underline type to useFontUnderline
public void setUnderline(FontUnderline underline)
underline
- - FontUnderline enum valuepublic 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 valueFontScheme
public int getFamily()
FontFamily
public void setFamily(int value)
value
- - font familyFontFamily
public void setFamily(FontFamily family)
family
- font familysetFamily(int value)
@Deprecated public short getIndex()
Font
public int getIndexAsInt()
Font
getIndexAsInt
in interface Font
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
Copyright 2020 The Apache Software Foundation or its licensors, as applicable.