FontSetting
Contents
[
Hide
]FontSetting class
Represents a range of characters within the cell text.
class FontSetting;
Example
const { Workbook, Color } = require("aspose.cells.node");
//Instantiating a Workbook object
var workbook = new Workbook();
//Adding a new worksheet to the Excel object
workbook.getWorksheets().add();
//Obtaining the reference of the newly added worksheet by passing its sheet index
var worksheet = workbook.getWorksheets().get(0);
//Accessing the "A1" cell from the worksheet
var cell = worksheet.getCells().get("A1");
//Adding some value to the "A1" cell
cell.putValue("Visit Aspose!");
//getting charactor
var charactor = cell.characters(6, 7);
//Setting the font of selected characters to bold
charactor.getFont().setIsBold(true);
//Setting the font color of selected characters to blue
charactor.getFont().setColor(Color.Blue);
//Saving the Excel file
workbook.save("output/FontSetting.xls");
Constructors
Name | Description |
---|---|
constructor(number, number, WorksheetCollection) |
Methods
Method | Description |
---|---|
getStartIndex() | Gets the start index of the characters. |
getLength() | Gets the length of the characters. |
getFont() | Returns the font of this object. |
getTextOptions() | Returns the text options. |
setWordArtStyle(PresetWordArtStyle) | Sets the preset WordArt style. |
isNull() | Checks whether the implementation object is null. |
getType() | Gets the type of text node. |
constructor(number, number, WorksheetCollection)
constructor(startIndex: number, length: number, sheets: WorksheetCollection);
Parameters:
Parameter | Type | Description |
---|---|---|
startIndex | number | |
length | number | |
sheets | WorksheetCollection |
getStartIndex()
Gets the start index of the characters.
getStartIndex() : number;
getLength()
Gets the length of the characters.
getLength() : number;
getFont()
Returns the font of this object.
getFont() : Font;
Returns
getTextOptions()
Returns the text options.
getTextOptions() : TextOptions;
Returns
setWordArtStyle(PresetWordArtStyle)
Sets the preset WordArt style.
setWordArtStyle(style: PresetWordArtStyle) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
style | PresetWordArtStyle | The preset WordArt style. |
Remarks
Only for the text of shape/chart.
isNull()
Checks whether the implementation object is null.
isNull() : boolean;
getType()
Gets the type of text node.
getType() : TextNodeType;
Returns