| 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 Calibry font in font size 11
|
static short |
DEFAULT_FONT_SIZE
By default, Microsoft Office Excel 2007 uses the Calibry 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| Modifier | Constructor and Description |
|---|---|
protected |
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()
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
|
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.BLACKpublic XSSFFont(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont font)
font - the underlying CTFont beanpublic XSSFFont(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont font,
int index,
IndexedColorMap colorMap)
font - CTFontindex - font indexcolorMap - for default or custom indexed colorsprotected XSSFFont()
@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont getCTFont()
public boolean getBold()
public int getCharSet()
getCharSet in interface FontFontCharsetpublic short getColor()
getColor in interface FontIndexedColorspublic 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 FontgetFontHeightInPoints()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 FontgetFontHeight()public java.lang.String getFontName()
getFontName in interface Fontpublic boolean getItalic()
public boolean getStrikeout()
getStrikeout in interface Fontpublic short getTypeOffset()
getTypeOffset in interface FontFont.SS_NONE,
Font.SS_SUPER,
Font.SS_SUBpublic byte getUnderline()
getUnderline in interface FontFontUnderlinepublic void setBold(boolean bold)
public void setCharSet(byte charset)
setCharSet in interface Fontcharset - - charsetFontCharsetpublic void setCharSet(int charset)
setCharSet in interface Fontcharset - - charsetFontCharsetpublic void setCharSet(FontCharset charSet)
charSet - public void setColor(short color)
setColor in interface Fontcolor - - color to use- Note: default font color,
IndexedColorspublic void setColor(XSSFColor color)
color - - color to usepublic void setFontHeight(short height)
setFontHeight in interface Fontheight - - height in pointsFont.setFontHeightInPoints(short)public void setFontHeight(double height)
height - - height in pointspublic void setFontHeightInPoints(short height)
setFontHeightInPoints in interface Fontheight - 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 Fontname - - value representing the name of the font to useDEFAULT_FONT_NAMEpublic void setItalic(boolean italic)
public void setStrikeout(boolean strikeout)
setStrikeout in interface Fontstrikeout - - value for strikeout or notpublic void setTypeOffset(short offset)
setTypeOffset in interface Fontoffset - - offset type to use (none,super,sub)Font.SS_NONE,
Font.SS_SUPER,
Font.SS_SUBpublic void setUnderline(byte underline)
setUnderline in interface Fontunderline - - underline type to useFontUnderlinepublic void setUnderline(FontUnderline underline)
underline - - FontUnderline enum valuepublic java.lang.String toString()
toString in class java.lang.Objectpublic long registerTo(StylesTable styles)
public void setThemesTable(ThemesTable themes)
public FontScheme getScheme()
StylesTable.createDefaultFont()public void setScheme(FontScheme scheme)
scheme - - FontScheme enum valueFontSchemepublic int getFamily()
FontFamilypublic void setFamily(int value)
value - - font familyFontFamilypublic void setFamily(FontFamily family)
family - font familysetFamily(int value)public short getIndex()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.ObjectCopyright 2018 The Apache Software Foundation or its licensors, as applicable.