RichTextShape
SetFont Method
|
Sets the font for a range of text in a shape's text object.
Validates the input parameters, checks for existing font settings, and updates the font settings accordingly.
Namespace:
Spire.Xls.Core.Spreadsheet
Assembly:
Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
public void SetFont(
int startIndex,
int endIndex,
IFont font
)
Public Sub SetFont (
startIndex As Integer,
endIndex As Integer,
font As IFont
)
public:
virtual void SetFont(
int startIndex,
int endIndex,
IFont^ font
) sealed
abstract SetFont :
startIndex : int *
endIndex : int *
font : IFont -> unit
override SetFont :
startIndex : int *
endIndex : int *
font : IFont -> unit
Parameters
-
startIndex
-
Type:
System
Int32
The starting index of the text range.
-
endIndex
-
Type:
System
Int32
The ending index of the text range.
-
font
-
Type:
Spire.Xls.Core
IFont
The font to apply to the specified text range.
Implements
IRichTextString
SetFont(Int32, Int32, IFont)
Exceptions
Exception
|
Condition
|
ArgumentOutOfRangeException
|
Thrown when the startIndex is greater than or equal to the text length, or when startIndex is greater than endIndex.
|
See Also