public class Font
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!"); Style style = cell.getStyle(); Font font = style.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()); cell.setStyle(style); //Saving the Excel file workbook.save("d:\\dest.xls");
Property Getters/Setters Summary | ||
---|---|---|
int | getArgbColor() | |
void | setArgbColor(intvalue) | |
Gets and sets the color with a 32-bit ARGB value. | ||
int | getCapsType() | |
void | setCapsType(intvalue) | |
Gets and sets the text caps type. The value of the property is TextCapsType integer constant. | ||
int | getCharset() | |
void | setCharset(intvalue) | |
Represent the character set. | ||
com.aspose.cells.Color | getColor() | |
void | setColor(com.aspose.cells.Colorvalue) | |
Gets or sets the |
||
double | getDoubleSize() | |
void | setDoubleSize(doublevalue) | |
Gets and sets the double size of the font. | ||
boolean | isBold() | |
void | setBold(booleanvalue) | |
Gets or sets a value indicating whether the font is bold. | ||
boolean | isItalic() | |
void | setItalic(booleanvalue) | |
Gets or sets a value indicating whether the font is italic. | ||
boolean | isNormalizeHeights() | |
void | setNormalizeHeights(booleanvalue) | |
Indicates whether the normalization of height that is to be applied to the text run. | ||
boolean | isStrikeout() | |
void | setStrikeout(booleanvalue) | |
Gets or sets a value indicating whether the font is single strikeout. | ||
boolean | isSubscript() | |
void | setSubscript(booleanvalue) | |
Gets or sets a value indicating whether the font is subscript. | ||
boolean | isSuperscript() | |
void | setSuperscript(booleanvalue) | |
Gets or sets a value indicating whether the font is super script. | ||
java.lang.String | getName() | |
void | setName(java.lang.Stringvalue) | |
Gets or sets the name of the |
||
int | getSchemeType() | |
void | setSchemeType(intvalue) | |
Gets and set sthe scheme type of the font. The value of the property is FontSchemeType integer constant. | ||
double | getScriptOffset() | |
void | setScriptOffset(doublevalue) | |
Gets and sets the sript offset,in unit of percentage | ||
int | getSize() | |
void | setSize(intvalue) | |
Gets or sets the size of the font. | ||
int | getStrikeType() | |
void | setStrikeType(intvalue) | |
Gets the strike type of the text. The value of the property is TextStrikeType integer constant. | ||
ThemeColor | getThemeColor() | |
void | setThemeColor(ThemeColor value) | |
Gets and sets the theme color. | ||
int | getUnderline() | |
void | setUnderline(intvalue) | |
Gets or sets the font underline type. The value of the property is FontUnderlineType integer constant. |
Method Summary | ||
---|---|---|
boolean | equals(Font font) | |
Checks if two fonts are equals.
|
||
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() / public void setCapsType(int value)
public int getStrikeType() / public void setStrikeType(int value)
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() / public void setUnderline(int value)
public java.lang.String getName() / public void setName(java.lang.String value)
Example:
Font font = style.getFont(); font.setName("Times New Roman");
public double getDoubleSize() / public void setDoubleSize(double value)
public int getSize() / public void setSize(int value)
public ThemeColor getThemeColor() / public void setThemeColor(ThemeColor value)
public com.aspose.cells.Color getColor() / public void setColor(com.aspose.cells.Color value)
public int getArgbColor() / public void setArgbColor(int value)
public boolean isNormalizeHeights() / public void setNormalizeHeights(boolean value)
public int getSchemeType() / public void setSchemeType(int value)
public boolean equals(Font font)
font
- Compared font object.public java.lang.String toString()