Class FontSetting
Class FontSetting
Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)
Represents a range of characters within the cell text.
public class FontSetting
Inheritance
Derived
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Examples
csharp
[C#]
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Adding a new worksheet to the Excel object
workbook.Worksheets.Add();
//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("Visit Aspose!");
//getting charactor
FontSetting charactor = cell.Characters(6, 7);
//Setting the font of selected characters to bold
charactor.Font.IsBold = true;
//Setting the font color of selected characters to blue
charactor.Font.Color = Color.Blue;
//Saving the Excel file
workbook.Save("book1.xls");
'Instantiating a Workbook object
Dim workbook As Workbook = New Workbook()
'Adding a new worksheet to the Excel object
workbook.Worksheets.Add()
'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("Visit Aspose!")
'getting charactor
Dim charactor As FontSetting = cell.Characters(6, 7)
'Setting the font of selected characters to bold
charactor.Font.IsBold = True
'Setting the font color of selected characters to blue
charactor.Font.Color = Color.Blue
'Saving the Excel file
workbook.Save("book1.xls")
Constructors
FontSetting(int, int, WorksheetCollection)
public FontSetting(int startIndex, int length, WorksheetCollection sheets)
Parameters
startIndex
int
length
int
sheets
WorksheetCollection
Properties
Font
Returns the font of this object.
public Font Font { get; }
Property Value
Length
Gets the length of the characters.
public int Length { get; }
Property Value
StartIndex
Gets the start index of the characters.
public int StartIndex { get; }
Property Value
TextOptions
Returns the text options.
public TextOptions TextOptions { get; }
Property Value
Type
Gets the type of text node.
public virtual TextNodeType Type { get; }
Property Value
Methods
SetWordArtStyle(PresetWordArtStyle)
Sets the preset WordArt style.
public void SetWordArtStyle(PresetWordArtStyle style)
Parameters
style
PresetWordArtStyle
The preset WordArt style.
Remarks
Only for the text of shape/chart.