FontSetting

Inheritance: java.lang.Object

public class FontSetting

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("book1.xls");

Constructors

ConstructorDescription
FontSetting(int startIndex, int length, WorksheetCollection sheets)

Methods

MethodDescription
equals(Object arg0)
getClass()
getFont()Returns the font of this object.
getLength()Gets the length of the characters.
getStartIndex()Gets the start index of the characters.
getTextOptions()Returns the text options.
getType()Gets the type of text node.
hashCode()
notify()
notifyAll()
setWordArtStyle(int style)Sets the preset WordArt style.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

FontSetting(int startIndex, int length, WorksheetCollection sheets)

public FontSetting(int startIndex, int length, WorksheetCollection sheets)

Parameters:

ParameterTypeDescription
startIndexint
lengthint
sheetsWorksheetCollection

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getFont()

public Font getFont()

Returns the font of this object.

Returns: Font

getLength()

public int getLength()

Gets the length of the characters.

Returns: int

getStartIndex()

public int getStartIndex()

Gets the start index of the characters.

Returns: int

getTextOptions()

public TextOptions getTextOptions()

Returns the text options.

Returns: TextOptions

getType()

public int getType()

Gets the type of text node.

See TextNodeType.

Returns: int

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setWordArtStyle(int style)

public void setWordArtStyle(int style)

Sets the preset WordArt style.

Remarks

Only for the text of shape/chart.

Parameters:

ParameterTypeDescription
styleintPresetWordArtStyle. The preset WordArt style.

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int