Aspose::Cells::Font class
Contents
[
Hide
]Font class
Encapsulates the font object used in a spreadsheet.
class Font
Methods
Method | Description |
---|---|
Equals(const Aspose::Cells::Font& font) | Checks if two fonts are equals. |
Font(Font_Impl* impl) | Constructs from an implementation object. |
Font(const Aspose::Cells::Font& src) | Copy constructor. |
GetArgbColor() | Gets and sets the color with a 32-bit ARGB value. |
GetCapsType() | Gets and sets the text caps type. |
GetCharset() | Represent the character set. |
GetColor() | Gets or sets the Color of the font. |
GetDoubleSize() | Gets and sets the double size of the font. |
GetName() | Gets or sets the name of the Font. |
GetSchemeType() | Gets and sets the scheme type of the font. |
GetScriptOffset() | Gets and sets the script offset,in unit of percentage. |
GetSize() | Gets or sets the size of the font. |
GetStrikeType() | Gets the strike type of the text. |
GetThemeColor() | Gets and sets the theme color. |
GetUnderline() | Gets or sets the font underline type. |
IsBold() | Gets or sets a value indicating whether the font is bold. |
IsItalic() | Gets or sets a value indicating whether the font is italic. |
IsNormalizeHeights() | Indicates whether the normalization of height that is to be applied to the text run. |
IsNull() const | Checks whether the implementation object is nullptr. |
IsStrikeout() | Gets or sets a value indicating whether the font is single strikeout. |
IsSubscript() | Gets or sets a value indicating whether the font is subscript. |
IsSuperscript() | Gets or sets a value indicating whether the font is super script. |
explicit operator bool() const | operator bool() |
operator=(const Aspose::Cells::Font& src) | operator= |
SetArgbColor(int32_t value) | Gets and sets the color with a 32-bit ARGB value. |
SetCapsType(TextCapsType value) | Gets and sets the text caps type. |
SetCharset(int32_t value) | Represent the character set. |
SetColor(const Aspose::Cells::Color& value) | Gets or sets the Color of the font. |
SetDoubleSize(double value) | Gets and sets the double size of the font. |
SetIsBold(bool value) | Gets or sets a value indicating whether the font is bold. |
SetIsItalic(bool value) | Gets or sets a value indicating whether the font is italic. |
SetIsNormalizeHeights(bool value) | Indicates whether the normalization of height that is to be applied to the text run. |
SetIsStrikeout(bool value) | Gets or sets a value indicating whether the font is single strikeout. |
SetIsSubscript(bool value) | Gets or sets a value indicating whether the font is subscript. |
SetIsSuperscript(bool value) | Gets or sets a value indicating whether the font is super script. |
SetName(const U16String& value) | Gets or sets the name of the Font. |
SetName(const char16_t* value) | Gets or sets the name of the Font. |
SetSchemeType(FontSchemeType value) | Gets and sets the scheme type of the font. |
SetScriptOffset(double value) | Gets and sets the script offset,in unit of percentage. |
SetSize(int32_t value) | Gets or sets the size of the font. |
SetStrikeType(TextStrikeType value) | Gets the strike type of the text. |
SetThemeColor(const ThemeColor& value) | Gets and sets the theme color. |
SetUnderline(FontUnderlineType value) | Gets or sets the font underline type. |
ToString() | Returns a string represents the current Cell object. |
~Font() | Destructor. |
Fields
Field | Description |
---|---|
_impl | The implementation object. |
Examples
Aspose::Cells::Startup();
//Instantiating a Workbook object
Workbook 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(u"A1");
//Adding some value to the "A1" cell
cell.PutValue(u"Hello Aspose!");
Font font = cell.GetStyle().GetFont();
//Setting the font name to "Times New Roman"
font.SetName(u"Times New Roman");
//Setting font size to 14
font.SetSize(14);
//setting font color as Red
font.SetColor(Color{ 0xff, 0xff, 0, 0 });//Red
//Saving the Excel file
workbook.Save(u"dest.xls");
Aspose::Cells::Cleanup();
See Also
- Namespace Aspose::Cells
- Library Aspose.Cells for C++