Class TextOptions

TextOptions class

Represents the text options.

public class TextOptions : Font

Properties

NameDescription
ArgbColor { get; set; }Gets and sets the color with a 32-bit ARGB value.(Inherited from Font.)
CapsType { get; set; }Gets and sets the text caps type.(Inherited from Font.)
Charset { get; set; }Represent the character set.(Inherited from Font.)
Color { get; set; }Gets or sets the Color of the font.(Inherited from Font.)
DoubleSize { get; set; }Gets and sets the double size of the font.(Inherited from Font.)
FarEastName { get; set; }Gets and sets the FarEast name.
Fill { get; }Represents the fill format of the text.
IsBold { get; set; }Gets or sets a value indicating whether the font is bold.(Inherited from Font.)
IsItalic { get; set; }Gets or sets a value indicating whether the font is italic.(Inherited from Font.)
IsNormalizeHeights { get; set; }Indicates whether the normalization of height that is to be applied to the text run.(Inherited from Font.)
IsStrikeout { get; set; }Gets or sets a value indicating whether the font is single strikeout.(Inherited from Font.)
IsSubscript { get; set; }Gets or sets a value indicating whether the font is subscript.(Inherited from Font.)
IsSuperscript { get; set; }Gets or sets a value indicating whether the font is super script.(Inherited from Font.)
Kerning { get; set; }Specifies the minimum font size at which character kerning will occur for this text run.
LanguageCode { get; set; }Gets and sets the user interface language.
LatinName { get; set; }Gets and sets the latin name.
override Name { get; set; }Gets and sets the name of the shape.
Outline { get; }Represents the outline format of the text.
SchemeType { get; set; }Gets and sets the scheme type of the font.(Inherited from Font.)
ScriptOffset { get; set; }Gets and sets the script offset,in unit of percentage(Inherited from Font.)
Shadow { get; }Represents a ShadowEffect object that specifies shadow effect for the chart element or shape.
Size { get; set; }Gets or sets the size of the font.(Inherited from Font.)
Spacing { get; set; }Specifies the spacing between characters within a text run.
StrikeType { get; set; }Gets the strike type of the text.(Inherited from Font.)
ThemeColor { get; set; }Gets and sets the theme color.(Inherited from Font.)
Underline { get; set; }Gets or sets the font underline type.(Inherited from Font.)
UnderlineColor { get; set; }Gets or sets the color of underline.

Methods

NameDescription
Equals(Font)Checks if two fonts are equals.(Inherited from Font.)
override ToString()Returns a string represents the current Cell object.(Inherited from Font.)

Examples

using System;
using Aspose.Cells;
using Aspose.Cells.Drawing;
using Aspose.Cells.Drawing.Texts;

namespace AsposeCellsExamples
{
    public class TextsClassTextOptionsDemo
    {
        public static void Run()
        {
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];
            
            // Add a shape to the worksheet with all required parameters
            Shape shape = worksheet.Shapes.AddRectangle(1, 0, 1, 100, 200, 0);
            
            // Add text to the shape and get TextOptions
            shape.TextBody.Text = "Sample Text";
            TextOptions textOptions = shape.TextBody[2].TextOptions;
            
            // Set text options
            textOptions.Fill.SolidFill.Color = System.Drawing.Color.Red;
            textOptions.Fill.SolidFill.Transparency = 0.5;
            
            // Save the workbook
            workbook.Save("TextOptionsDemo.xlsx");
        }
    }
}

See Also