asposecells.api

Class FontSetting

Represents a range of characters within the cell text.

Example:

# Instantiating a Workbook object
workbook = 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
worksheet = workbook.getWorksheets().get(0)
# Accessing the "A1" cell from the worksheet
cell = worksheet.getCells().get("A1")
# Adding some value to the "A1" cell
cell.putValue("Visit Aspose!")
# getting charactor
charactor = cell.characters(6, 7)
# Setting the font of selected characters to bold
charactor.getFont().setBold(True)
# Setting the font color of selected characters to blue
charactor.getFont().setColor(Color.getBlue())
# Saving the Excel file
workbook.save("Book1.xls")

Constructor Summary
FontSetting(startIndex, length, sheets)
 
Property Getters/Setters Summary
methodgetFont()
Returns the font of this object.
methodgetLength()
Gets the length of the characters.
methodgetStartIndex()
Gets the start index of the characters.
methodgetTextOptions()
Returns the text options.
methodgetType()
Gets the type of text node.
 
Method Summary
methodsetWordArtStyle(style)
Sets the preset WordArt style.
 

    • Constructor Detail

      • FontSetting

        FontSetting(startIndex, length, sheets)
        Parameters:
        startIndex: int -
        length: int -
        sheets: WorksheetCollection -
    • Property Getters/Setters Detail

      • getType : TextNodeType 

        TextNodeType getType()
        
        Gets the type of text node.
      • getStartIndex : int 

        int getStartIndex()
        
        Gets the start index of the characters.
      • getLength : int 

        int getLength()
        
        Gets the length of the characters.
      • getFont : Font 

        Font getFont()
        
        Returns the font of this object.
      • getTextOptions : TextOptions 

        TextOptions getTextOptions()
        
        Returns the text options.
    • Method Detail

      • setWordArtStyle

         setWordArtStyle(style)
        Sets the preset WordArt style. Only for the text of shape/chart.
        Parameters:
        style: int - A PresetWordArtStyle value. The preset WordArt style.