@zeplin/extension-model
    Preparing search index...

    Class TextStyle

    Class representing a text style

    Index

    Constructors

    Properties

    color?: Color

    Text color

    fontFace: string

    Full name of the text style's typeface.

    fontFamily: string

    Font family of the text

    fontSize: number

    Font size of the text

    fontStretch?: string

    The stretch form of the text style. e.g., condensed, expanded, etc.

    fontStyle: string

    Font style of the text

    fontVariantAlternates?: string

    Font variant alternates

    fontVariantCaps?: string

    Font variant caps

    fontVariantEastAsian?: string

    Font variant east asian

    fontVariantLigatures?: string

    Font variant ligatures

    fontVariantNumeric?: string

    Font variant numeric

    fontVariantPosition?: string

    Font variant position

    fontVariationSettings?: FontVariationSettings

    Variation axis values of the font.

    fontWeight: number

    Font weight of the text

    hyperlink?: string

    Hyperlink of the text style.

    letterSpacing?: number

    Letter spacing

    lineHeight?: number

    Line height

    listSpacing?: number

    List spacing of the text style.

    name: string

    Given name of the text style in the context where it is used.

    paragraphIndent?: number

    Paragraph indent of the text style.

    paragraphSpacing?: number

    Paragraph spacing of the text style.

    scaledFontSize?: number
    sourceId: string

    Id of the text style in the source design document.

    textAlign?: TextAlignment

    Text alignment

    textDecoration?: TextDecoration

    Text decoration

    textTransform?: TextTransform

    Text transform

    verticalAlignment?: VerticalAlignment

    Vertical alignment

    weightText: string

    Textual representation of the text style's weight. e.g., "bold" for 700, "medium" for 500, etc.

    Accessors

    • get TEXT_ALIGN(): Readonly<Record<string, string>>

      Returns Readonly<Record<string, string>>

    • get TEXT_TRANSFORM(): Readonly<Record<string, string>>

      Returns Readonly<Record<string, string>>

    • get TEXT_VERTICAL_ALIGN(): Readonly<Record<string, string>>

      Returns Readonly<Record<string, string>>

    • get WEIGHT(): Readonly<Record<string, number>>

      Returns Readonly<Record<string, number>>

    Methods

    • Checks whether some other text style conforms to this one

      Parameters

      • t: TextStyle

        TextStyle object to be compared.

      Returns boolean

      True if the text style conforms to this one, false otherwise

    • Checks whether some other text style is equal to this one

      Parameters

      • t: TextStyle

        TextStyle object to be compared.

      Returns boolean

      True if the text styles are equal, false otherwise

    • Checks if font variation settings are equal to the provided settings

      Parameters

      • fvs: FontVariationSettings

        Font variation settings to compare with

      Returns boolean

      True if the settings are equal, false otherwise

    • Creates a TextStyle instance from a JSON string

      Parameters

      • json: string

        JSON string representing a text style

      Returns TextStyle

      A new TextStyle instance