Abstract base class which controls the formatting of a range of characters in a [[FormattedString]] or [[FormattedText]].

See

  • [[FormattedStringFont]]
  • [[FormattedTextFont]]

Hierarchy

Hierarchy (view full)

Implements

Constructors

  • Parameters

    • a: IFormattedItem
    • b: number
    • c: number

    Returns FormattedFontBase

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

  • get bold(): boolean
  • Gets or sets the value indicating whether the font is bold.

    All characters in the selection range of this font will be affected by setting this property. Getting this property will return a value which indicates the formatting of the first character in this font's range.

    Note: default values cannot be used in [[FormattedString]] values applied to cells. If this font belongs to a FormattedString which is the value of a cell, and a default value is assigned, it will be ignored.

    The value indicating whether the font is bold.

    Throws

    [[InvalidEnumArgumentException]] The value assigned is not defined in the ExcelDefaultableBoolean enumeration.

    Throws

    [[InvalidOperationException]] The formatted string or text associated with the font is not assigned to a cell, comment, or shape.

    Throws

    [[InvalidOperationException]] The font's selection range is outside the valid character range of the associated formatted string or text.

    Returns boolean

  • set bold(a): void
  • Parameters

    • a: boolean

    Returns void

  • get colorInfo(): WorkbookColorInfo
  • Gets or sets the fore color of the font.

    All characters in the selection range of this font will be affected by setting this property. Getting this property will return a value which indicates the formatting of the first character in this font's range.

    Note: default values cannot be used in [[FormattedString]] values applied to cells. If this font belongs to a FormattedString which is the value of a cell, and a default value is assigned, it will be ignored.

    The fore color of the font.

    Throws

    [[InvalidOperationException]] The formatted string or text associated with the font is not assigned to a cell, comment, or shape.

    Throws

    [[InvalidOperationException]] The font's selection range is outside the valid character range of the associated formatted string or text.

    Returns WorkbookColorInfo

  • set colorInfo(a): void
  • Parameters

    Returns void

  • get height(): number
  • Gets or sets the height of the font.

    All characters in the selection range of this font will be affected by setting this property. Getting this property will return a value which indicates the formatting of the first character in this font's range.

    Note: default values cannot be used in [[FormattedString]] values applied to cells. If this font belongs to a FormattedString which is the value of a cell, and a default value is assigned, it will be ignored.

    The height of the font.

    Throws

    [[ArgumentOutOfRangeException]] The value assigned is positive and outside the valid font height range of 20 and 8180.

    Throws

    [[InvalidOperationException]] The formatted string or text associated with the font is not assigned to a cell, comment, or shape.

    Throws

    [[InvalidOperationException]] The font's selection range is outside the valid character range of the associated formatted string or text.

    Returns number

  • set height(a): void
  • Parameters

    • a: number

    Returns void

  • get italic(): boolean
  • Gets or sets the value indicating whether the font is italic.

    All characters in the selection range of this font will be affected by setting this property. Getting this property will return a value which indicates the formatting of the first character in this font's range.

    Note: default values cannot be used in [[FormattedString]] values applied to cells. If this font belongs to a FormattedString which is the value of a cell, and a default value is assigned, it will be ignored.

    The value indicating whether the font is italic.

    Throws

    [[InvalidEnumArgumentException]] The value assigned is not defined in the ExcelDefaultableBoolean enumeration.

    Throws

    [[InvalidOperationException]] The formatted string or text associated with the font is not assigned to a cell, comment, or shape.

    Throws

    [[InvalidOperationException]] The font's selection range is outside the valid character range of the associated formatted string or text.

    Returns boolean

  • set italic(a): void
  • Parameters

    • a: boolean

    Returns void

  • get length(): number
  • Gets the number of characters covered by this font. Zero indicates the font controls from the [[startIndex]] to the end of the string. The number of characters covered by this font. Zero indicates the font controls from the StartIndex to the end of the string.

    Returns number

  • get name(): string
  • Gets or sets the name of the font.

    All characters in the selection range of this font will be affected by setting this property. Getting this property will return a value which indicates the formatting of the first character in this font's range.

    Note: default values cannot be used in [[FormattedString]] values applied to cells. If this font belongs to a FormattedString which is the value of a cell, and a default value is assigned, it will be ignored.

    The name of the font.

    Throws

    [[InvalidOperationException]] The formatted string or text associated with the font is not assigned to a cell, comment, or shape.

    Throws

    [[InvalidOperationException]] The font's selection range is outside the valid character range of the associated formatted string or text.

    Returns string

  • set name(a): void
  • Parameters

    • a: string

    Returns void

  • get startIndex(): number
  • Gets the index of the first character covered by this font. The index of the first character covered by this font.

    Returns number

  • get strikeout(): boolean
  • Gets or sets the value indicating whether the font is struck out.

    All characters in the selection range of this font will be affected by setting this property. Getting this property will return a value which indicates the formatting of the first character in this font's range.

    Note: default values cannot be used in [[FormattedString]] values applied to cells. If this font belongs to a FormattedString which is the value of a cell, and a default value is assigned, it will be ignored.

    The value indicating whether the font is struck out.

    Throws

    [[InvalidEnumArgumentException]] The value assigned is not defined in the ExcelDefaultableBoolean enumeration.

    Throws

    [[InvalidOperationException]] The formatted string or text associated with the font is not assigned to a cell, comment, or shape.

    Throws

    [[InvalidOperationException]] The font's selection range is outside the valid character range of the associated formatted string or text.

    Returns boolean

  • set strikeout(a): void
  • Parameters

    • a: boolean

    Returns void

  • get superscriptSubscriptStyle(): FontSuperscriptSubscriptStyle
  • Gets or sets the value indicating whether the font is superscript or subscript.

    All characters in the selection range of this font will be affected by setting this property. Getting this property will return a value which indicates the formatting of the first character in this font's range.

    Note: default values cannot be used in [[FormattedString]] values applied to cells. If this font belongs to a FormattedString which is the value of a cell, and a default value is assigned, it will be ignored.

    The value indicating whether the font is superscript or subscript.

    Throws

    [[InvalidEnumArgumentException]] The value assigned is not defined in the [[FontSuperscriptSubscriptStyle]] enumeration.

    Throws

    [[InvalidOperationException]] The formatted string or text associated with the font is not assigned to a cell, comment, or shape.

    Throws

    [[InvalidOperationException]] The font's selection range is outside the valid character range of the associated formatted string or text.

    Returns FontSuperscriptSubscriptStyle

  • set superscriptSubscriptStyle(a): void
  • Parameters

    Returns void

  • get underlineStyle(): FontUnderlineStyle
  • Gets or sets the underline style of the font.

    All characters in the selection range of this font will be affected by setting this property. Getting this property will return a value which indicates the formatting of the first character in this font's range.

    Note: default values cannot be used in [[FormattedString]] values applied to cells. If this font belongs to a FormattedString which is the value of a cell, and a default value is assigned, it will be ignored.

    The underline style of the font.

    Throws

    [[InvalidEnumArgumentException]] The value assigned is not defined in the [[FontUnderlineStyle]] enumeration.

    Throws

    [[InvalidOperationException]] The formatted string or text associated with the font is not assigned to a cell, comment, or shape.

    Throws

    [[InvalidOperationException]] The font's selection range is outside the valid character range of the associated formatted string or text.

    Returns FontUnderlineStyle

  • set underlineStyle(a): void
  • Parameters

    Returns void

Methods

  • Parameters

    • other: any

    Returns boolean

  • Returns number

  • Returns Base

  • Sets all properties of this font to the properties of the specified font.

    Note: default values cannot be used in [[FormattedString]] values applied to cells. If this font belongs to a FormattedString which is the value of a cell, any default values on the specified font will be ignored.

    Throws

    [[ArgumentNullException]] 'source' is null.

    Throws

    [[InvalidOperationException]] The formatted string or text associated with the font is not assigned to a cell, comment, or shape.

    Throws

    [[InvalidOperationException]] The font's selection range is outside the valid character range of the associated formatted string or text.

    Parameters

    • source: IWorkbookFont

      The font whose properties should be copied over to this font.

    Returns void

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns number

  • Parameters

    • a: any
    • b: any

    Returns boolean