SheetXL - v0.3.20
    Preparing search index...

    Interface IStyledFont

    Represents a font with styling color.

    interface IStyledFont {
        isIStyledFont: true;
        getExtend(): boolean;
        getFallbacks(): string[];
        getFamily(): string;
        getFill(): IColor;
        getLetterSpacing(): number;
        getOutline(): boolean;
        getScheme(): IFont.Scheme;
        getShadow(): boolean;
        getSize(): number;
        getStrike(): boolean;
        getStyle(): Style;
        getSuperSubScale(): number;
        getSuperSubShift(): number;
        getUnderline(): UnderlineStyle;
        getVerticalAlignment(): IFont.VerticalAlignment;
        getWeight(): number;
        isEqualMeasure(other: IStyledFont): boolean;
        isSuperSub(): boolean;
        toCSS(
            darkMode?: boolean,
            zoom?: number,
            excludeNormal?: boolean,
        ): Properties;
        toJSON(): JSON;
    }
    Index

    Properties

    isIStyledFont: true

    For runtime type checking.

    Methods

    • The effect extends or stretches out the text.

      Returns boolean

      Not rendered by Excel or SheetXL.

    • A list of fonts and their fallbacks. These can also be provided in the fontFamily attribute but will be normalized to here.

      Returns string[]

    • This can be set as a string using html values such as 'Arial 11pt' but will be resolved to a single font. Fallbacks and fontSize will be marshalled into their correct property.

      Returns string

    • The text color.

      Returns IColor

      Currently only solid fill is supported but this will be expanded to allow all fill types similar to DrawML.

    • Adds or removes additional spacing between the characters.

      Returns number

    • The effect draws the text as an outline.

      Returns boolean

      Not rendered by Excel or SheetXL.

    • The effect draws a shadow around the text.

      Returns boolean

      Not rendered by Excel or SheetXL.

    • Font size is either a number in points or a string that can be converted such as '14px', '1.5em'.

      Returns number

    • The effect draws the text with a line through it.

      Returns boolean

    • Returns Style

      IFont.Style.Normal

    • Returns the size to scale the font for super/sub text.

      Returns number

    • Returns the number of pixels to shift the font for super/sub text.

      Returns number

    • Sets the underline style. If true defaults to single. If false or null defaults to none.

      Returns UnderlineStyle

      IFont.UnderlineStyle.None

    • Returns the vertical alignment of the text within a text line.

      Returns IFont.VerticalAlignment

      If the IFont.VerticalAlignment is superscript or subscript then the font size should also render smaller.

    • The weight of the characters.

      Returns number

    • Compare against another font to see if they will have the same font measure This is used to optimize updates by not re-calcing the width/height

      Parameters

      Returns boolean

    • Returns true if the font is either a superscript or a subscript.

      Returns boolean

    • Returns the font styles as a set of css string that are suitable for css.

      Parameters

      • OptionaldarkMode: boolean
      • Optionalzoom: number
      • OptionalexcludeNormal: boolean

      Returns Properties

      Not all fill styles will offer an exact css equivalent. Additionally due to the nature of css having different properties for the same logic value (for example color, backgroundColor)

    • Serializes to a JSON object.

      Returns JSON