ShapeTextRange.Font Property
In This Article
Provides access to the text range’s font settings.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v24.2.Core.dll
NuGet Package: DevExpress.Spreadsheet.Core
#Declaration
ShapeTextFont Font { get; }
#Property Value
Type | Description |
---|---|
Shape |
A Shape |
#Remarks
Use the ShapeTextFont properties to change ShapeTextRange object’s color, capitalization, size, etc.
When you insert a new text range in a shape, its ShapeTextFont properties have the same values as the existing ShapeTextFont object’s font options.
Note
If a current Shape
#Example
ShapeText shapeText = shape4.ShapeText;
//Create a text range:
ShapeTextRange range = shapeText.Characters();
//Specify the shape's text
range.Text = "Shape ";
//Set font properties:
range.Font.Bold = true;
range.Font.Color = Color.YellowGreen;
//Add new text range after the existing text
//And specify the font parameters:
ShapeTextRange range2 = range.AddAfter("Text");
range2.Font.Italic = true;
range2.Font.Name = "Arial";
range2.Font.Color = Color.BurlyWood;
//Define the text's vertical and horizontal alignment:
shapeText.VerticalAnchor = ShapeTextVerticalAnchorType.Center;
shapeText.HorizontalAnchor = ShapeTextHorizontalAnchorType.Center;
See Also