SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface IStyledFont

    Represents a font with styling color.

    interface IStyledFont {
        isIStyledFont: true;
        getBold(): boolean;
        getCharset(): number | null;
        getColor(): IColor;
        getExtend(): boolean;
        getFallbacks(): string[];
        getFamily(): string;
        getItalic(): boolean;
        getLetterSpacing(): number;
        getOutline(): boolean;
        getScheme(): IFont.Scheme;
        getShadow(): boolean;
        getSize(): number;
        getStrike(): boolean;
        getStyle(): IFont.Style;
        getSuperSubScale(): number;
        getSuperSubShift(): number;
        getUnderline(): IFont.UnderlineStyle;
        getVerticalAlignment(): IFont.VerticalAlignment;
        getWeight(): number;
        isEqualMeasure(other: IStyledFont): boolean;
        isSuperSub(): boolean;
        setBold(bold: boolean | null, options?: UpdateOptions): IStyledFont;
        setCharset(charset: number | null, options?: UpdateOptions): IStyledFont;
        setColor(
            color: string | IColor | null,
            options?: UpdateOptions,
        ): IStyledFont;
        setExtend(extend: boolean | null, options?: UpdateOptions): IStyledFont;
        setFallbacks(
            fallbacks: string[] | null,
            options?: UpdateOptions,
        ): IStyledFont;
        setFamily(family: string | null, options?: UpdateOptions): IStyledFont;
        setItalic(italic: boolean | null, options?: UpdateOptions): IStyledFont;
        setLetterSpacing(
            letterSpacing: number | null,
            options?: UpdateOptions,
        ): IStyledFont;
        setOutline(outline: boolean | null, options?: UpdateOptions): IStyledFont;
        setScheme(
            scheme: IFont.Scheme | null,
            options?: UpdateOptions,
        ): IStyledFont;
        setShadow(shadow: boolean | null, options?: UpdateOptions): IStyledFont;
        setSize(size: number | null, options?: UpdateOptions): IStyledFont;
        setStrike(strike: boolean | null, options?: UpdateOptions): IStyledFont;
        setStyle(style: IFont.Style | null, options?: UpdateOptions): IStyledFont;
        setUnderline(
            underline: IFont.UnderlineStyle | null,
            options?: UpdateOptions,
        ): IStyledFont;
        setVerticalAlignment(
            verticalAlignment: IFont.VerticalAlignment | null,
            options?: UpdateOptions,
        ): IStyledFont;
        setWeight(weight: number | null, options?: UpdateOptions): IStyledFont;
        toCSS(mode?: CSSMode, zoom?: number, ignoreNormal?: boolean): Properties;
        toJSON(): IStyledFont.JSON;
    }
    Index
    isIStyledFont: true

    For runtime type checking.

    • Convenience for IStyledFont.getWeight. Returns true when the weight is bold (> 400).

      Returns boolean

    • The character set the font was authored against, or null when the font does not name one.

      Returns number | null

      Purely a font-substitution hint - see IFont.Charset. Cell text is Unicode either way, so this does not change what a cell contains or, when the named family is installed, how it renders.

    • 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.

      A font with a scheme of major or minor is a theme font and reports the theme's heading or body font; a font with no family of its own reports the theme body font.

      Returns string

    • Convenience for IStyledFont.getStyle. Returns true when the style is italic.

      Returns boolean

    • 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 theme font this font refers to, if any. A major or minor scheme makes the font follow the theme's heading or body font, overriding family.

      Returns IFont.Scheme

      IFont.Scheme.None

    • 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 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

    • 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

      • Optionalmode: CSSMode
      • Optionalzoom: number
      • OptionalignoreNormal: 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)