public class Font
extends java.lang.Object
Example
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.getWorksheets().get(0);
//Accessing the "A1" cell from the worksheet
Cell cell = worksheet.getCells().get("A1");
//Adding some value to the "A1" cell
cell.putValue("Hello Aspose!");
Font font = cell.getStyle().getFont();
//Setting the font name to "Times New Roman"
font.setName("Times New Roman");
//Setting font size to 14
font.setSize(14);
//setting font color as Red
font.setColor(com.aspose.cells.Color.getRed());
//Saving the Excel file
workbook.save("dest.xls");
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Font font)
Checks if two fonts are equals.
|
int |
getArgbColor()
Gets the color with a 32-bit ARGB value.
|
int |
getCapsType()
Gets the text caps type.
|
int |
getCharset()
Represent the character set.
|
Color |
getColor()
Gets the
Color of the font. |
double |
getDoubleSize()
Gets the double size of the font.
|
java.lang.String |
getName()
Gets the name of the
ChartArea.getFont(). |
int |
getSchemeType()
Gets the scheme type of the font.
|
double |
getScriptOffset()
Gets the script offset,in unit of percentage
|
int |
getSize()
Gets the size of the font.
|
int |
getStrikeType()
Gets the strike type of the text.
|
ThemeColor |
getThemeColor()
Gets the theme color.
|
int |
getUnderline()
Gets the font underline type.
|
boolean |
isBold()
Gets a value indicating whether the font is bold.
|
boolean |
isItalic()
Gets a value indicating whether the font is italic.
|
boolean |
isNormalizeHeights()
Indicates whether the normalization of height that is to be applied to the text run.
|
boolean |
isStrikeout()
Gets a value indicating whether the font is single strikeout.
|
boolean |
isSubscript()
Gets a value indicating whether the font is subscript.
|
boolean |
isSuperscript()
Gets a value indicating whether the font is super script.
|
void |
setArgbColor(int value)
Sets the color with a 32-bit ARGB value.
|
void |
setBold(boolean value)
Sets a value indicating whether the font is bold.
|
void |
setCapsType(int value)
Sets the text caps type.
|
void |
setCharset(int value)
Represent the character set.
|
void |
setColor(Color value)
Sets the
Color of the font. |
void |
setDoubleSize(double value)
Sets the double size of the font.
|
void |
setItalic(boolean value)
Sets a value indicating whether the font is italic.
|
void |
setName(java.lang.String value)
Sets the name of the
ChartArea.getFont(). |
void |
setNormalizeHeights(boolean value)
Indicates whether the normalization of height that is to be applied to the text run.
|
void |
setSchemeType(int value)
Sets the scheme type of the font.
|
void |
setScriptOffset(double value)
Sets the script offset,in unit of percentage
|
void |
setSize(int value)
Sets the size of the font.
|
void |
setStrikeout(boolean value)
Sets a value indicating whether the font is single strikeout.
|
void |
setStrikeType(int value)
Gets the strike type of the text.
|
void |
setSubscript(boolean value)
Sets a value indicating whether the font is subscript.
|
void |
setSuperscript(boolean value)
Sets a value indicating whether the font is super script.
|
void |
setThemeColor(ThemeColor value)
Sets the theme color.
|
void |
setUnderline(int value)
Sets the font underline type.
|
java.lang.String |
toString()
Returns a string represents the current Cell object.
|
public int getCharset()
public void setCharset(int value)
public boolean isItalic()
public void setItalic(boolean value)
public boolean isBold()
public void setBold(boolean value)
public int getCapsType()
See TextCapsType.
public void setCapsType(int value)
See TextCapsType.
public int getStrikeType()
See TextStrikeType.
public void setStrikeType(int value)
See TextStrikeType.
public boolean isStrikeout()
public void setStrikeout(boolean value)
public double getScriptOffset()
public void setScriptOffset(double value)
public boolean isSuperscript()
public void setSuperscript(boolean value)
public boolean isSubscript()
public void setSubscript(boolean value)
public int getUnderline()
See FontUnderlineType.
public void setUnderline(int value)
See FontUnderlineType.
public java.lang.String getName()
ChartArea.getFont().public void setName(java.lang.String value)
ChartArea.getFont().public double getDoubleSize()
public void setDoubleSize(double value)
public int getSize()
public void setSize(int value)
public ThemeColor getThemeColor()
Remarks
If the font color is not a theme color, NULL will be returned.public void setThemeColor(ThemeColor value)
Remarks
If the font color is not a theme color, NULL will be returned.public int getArgbColor()
public void setArgbColor(int value)
public boolean equals(Font font)
font - Compared font object.public boolean isNormalizeHeights()
public void setNormalizeHeights(boolean value)
public int getSchemeType()
See FontSchemeType.
public void setSchemeType(int value)
See FontSchemeType.
public java.lang.String toString()
toString in class java.lang.ObjectSee Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.