FontSetting

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

NameDescription
constructor(number, number, WorksheetCollection)

Methods

MethodDescription
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:

ParameterTypeDescription
startIndexnumber
lengthnumber
sheetsWorksheetCollection

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

Font

getTextOptions()

Returns the text options.

getTextOptions() : TextOptions;

Returns

TextOptions

setWordArtStyle(PresetWordArtStyle)

Sets the preset WordArt style.

setWordArtStyle(style: PresetWordArtStyle) : void;

Parameters:

ParameterTypeDescription
stylePresetWordArtStyleThe 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

TextNodeType