com.aspose.cells

Class FontSetting

  • java.lang.Object
    • com.aspose.cells.FontSetting
public class FontSetting 
extends java.lang.Object

Represents a range of characters within the cell text.

Example:

//Instantiating a Workbook object
Workbook 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
Worksheet worksheet = workbook.getWorksheets().get(0);

//Accessing the "A1" cell from the worksheet
Cell cell = worksheet.getCells().get("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.getFont().setBold(true);

//Setting the font color of selected characters to blue
charactor.getFont().setColor(Color.getBlue());

//Saving the Excel file
workbook.save("D:\\book1.xls");

Constructor Summary
FontSetting(intstartIndex, intlength, WorksheetCollection sheets)
 
Property Getters/Setters Summary
FontgetFont()
Returns the font of this object.
intgetLength()
Gets the length of the characters.
ShapeFontgetShapeFont()
Returns the text options.
intgetStartIndex()
Gets the start index of the characters.
TextOptionsgetTextOptions()
Returns the text options.
TextNodeTypegetType()
Gets the type of text node.
 
Method Summary
voidsetWordArtStyle(intstyle)
Sets the preset WortArt style.
 

    • Constructor Detail

      • FontSetting

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

      • getType

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

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

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

        public Font getFont()
        
        Returns the font of this object.
      • getShapeFont

        public ShapeFont getShapeFont()
        
        Returns the text options. NOTE: This member is now obsolete. Instead, please use FontSetting.TextOptions property. This property will be removed 6 months later since August 2016. Aspose apologizes for any inconvenience you may have experienced.
      • getTextOptions

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

      • setWordArtStyle

        public void setWordArtStyle(int style)
                            throws java.lang.Exception
        Sets the preset WortArt style. Only for the text of shape/chart.
        Parameters:
        style - A PresetWordArtStyle value. The preset WortArt style.