Font Class
Encapsulates the font object used in a spreadsheet.
Inheritance Hierarchy
SystemObject
  Aspose.CellsFont
    Aspose.Cells.Drawing.TextsTextOptions

Namespace: Aspose.Cells
Assembly: Aspose.Cells (in Aspose.Cells.dll) Version: 19.11.0.0 (19.11)
Syntax
[SerializableAttribute]
public class Font

The Font type exposes the following members.

Properties
  NameDescription
Public propertyArgbColor
Gets and sets the color with a 32-bit ARGB value.
Public propertyCapsType
Gets and sets the text caps type.
Public propertyCharset
Represent the character set.
Public propertyColor
Gets or sets the Color of the font.
Public propertyDoubleSize
Gets and sets the double size of the font.
Public propertyIsBold
Gets or sets a value indicating whether the font is bold.
Public propertyIsItalic
Gets or sets a value indicating whether the font is italic.
Public propertyIsNormalizeHeights
Indicates whether the normalization of height that is to be applied to the text run.
Public propertyIsStrikeout
Gets or sets a value indicating whether the font is single strikeout.
Public propertyIsSubscript
Gets or sets a value indicating whether the font is subscript.
Public propertyIsSuperscript
Gets or sets a value indicating whether the font is super script.
Public propertyCode exampleName
Gets or sets the name of the Font.
Public propertySchemeType
Gets and set sthe scheme type of the font.
Public propertyScriptOffset
Gets and sets the sript offset,in unit of percentage
Public propertySize
Gets or sets the size of the font.
Public propertyStrikeType
Gets the strike type of the text.
Public propertyThemeColor
Gets and sets the theme color.
Public propertyUnderline
Gets or sets the font underline type.
Methods
  NameDescription
Public methodEquals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodEquals(Font)
Checks if two fonts are equals.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string represents the current Cell object.
(Overrides ObjectToString.)
Examples
[C#]

//Instantiating a Workbook object
Workbook workbook = new Workbook();

//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.Worksheets[0];

//Accessing the "A1" cell from the worksheet
Aspose.Cells.Cell cell = worksheet.Cells["A1"];

//Adding some value to the "A1" cell
cell.PutValue("Hello Aspose!");

Aspose.Cells.Font font = cell.Style.Font;

//Setting the font name to "Times New Roman"
font.Name = "Times New Roman";

//Setting font size to 14
font.Size = 14;

//setting font color as Red
font.Color = System.Drawing.Color.Red;           

//Saving the Excel file
workbook.Save(@"d:\dest.xls");

[VB.NET]

'Instantiating a Workbook object
Dim workbook As New Workbook()

'Obtaining the reference of the newly added worksheet by passing its sheet index
Dim worksheet As Worksheet = workbook.Worksheets(0)

'Accessing the "A1" cell from the worksheet
Dim cell As Aspose.Cells.Cell = worksheet.Cells("A1")

'Adding some value to the "A1" cell
cell.PutValue("Hello Aspose!")

Dim font As Aspose.Cells.Font = cell.Style.Font

'Setting the font name to "Times New Roman"
font.Name = "Times New Roman"

'Setting font size to 14
font.Size = 14

'setting font color as Red
font.Color = System.Drawing.Color.Red

'Saving the Excel file
workbook.Save("d:\dest.xls")
See Also