Search Results for

    Show / Hide Table of Contents

    Class TextStyle

    Inheritance
    System.Object
    DocumentStyle
    TextStyle
    Implements
    ITextStyle
    IDocumentStyle
    Inherited Members
    DocumentStyle.StyleId
    DocumentStyle.Status
    Namespace: IronPPT.Models
    Assembly: IronPPT.dll
    Syntax
    public class TextStyle : DocumentStyle, ITextStyle, IDocumentStyle

    Character-level formatting on a run of slide text, the weight, slant, color, font, and underline a reader actually sees, is held by TextStyle. It is the concrete style a developer configures to make text bold, italic, colored, or underlined, and it is what a run carries when its appearance differs from the slide default. Reach for it when a single word or phrase needs its own look rather than inheriting the surrounding style.

    A TextStyle is built and then applied to the text run it formats, so the workflow is to set the properties that should change and leave the rest at their defaults. As a DocumentStyle it also carries a StyleId and a Status, which tie it into the document's wider style system. Clone produces an independent copy when one run's look should seed another, and Reset returns the style to its baseline.

    The everyday properties are IsBold, IsItalic, Color, TextFont, and Underline: the first two are simple flags, Color takes an IColor, TextFont an IFont, and Underline an IUnderline describing the underline stroke. Strike is a nullable StrikValue for strikethrough, Spacing a DocUnit for character spacing, and Outline toggles an outlined glyph. Languages, NoProof, and SpecVanish cover proofing language, spell-check suppression, and the spec-vanish flag. Set only what differs from the inherited style so a run stays in step with the rest of the text.

    var style = new TextStyle();
    style.IsBold = true;
    style.Color = new Color("#1A1A1A");

    The add text how-to covers placing and formatting text, the paragraph style example applies run styling in a worked slide, and the Underline reference details the underline stroke this style exposes.

    Constructors

    TextStyle()

    Declaration
    public TextStyle()

    Properties

    Color

    Declaration
    public IColor Color { get; set; }
    Property Value
    Type Description
    IColor

    IsBold

    Declaration
    public bool IsBold { get; set; }
    Property Value
    Type Description
    System.Boolean

    IsItalic

    Declaration
    public bool IsItalic { get; set; }
    Property Value
    Type Description
    System.Boolean

    Languages

    Declaration
    public string Languages { get; set; }
    Property Value
    Type Description
    System.String

    NoProof

    Declaration
    public bool NoProof { get; set; }
    Property Value
    Type Description
    System.Boolean

    Outline

    Declaration
    public bool Outline { get; set; }
    Property Value
    Type Description
    System.Boolean

    Spacing

    Declaration
    public DocUnit Spacing { get; set; }
    Property Value
    Type Description
    DocUnit

    SpecVanish

    Declaration
    public bool SpecVanish { get; set; }
    Property Value
    Type Description
    System.Boolean

    Strike

    Declaration
    public Nullable<StrikValue> Strike { get; set; }
    Property Value
    Type Description
    System.Nullable<StrikValue>

    TextFont

    Declaration
    public IFont TextFont { get; set; }
    Property Value
    Type Description
    IFont

    Underline

    Declaration
    public IUnderline Underline { get; set; }
    Property Value
    Type Description
    IUnderline

    Methods

    Clone()

    Declaration
    public ITextStyle Clone()
    Returns
    Type Description
    ITextStyle

    Reset()

    Declaration
    public ITextStyle Reset()
    Returns
    Type Description
    ITextStyle

    Implements

    ITextStyle
    IDocumentStyle

    Inherited members

    StyleId
    Status
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet