harfbuzzjs
    Preparing search index...

    Class Variation

    A HarfBuzz variation.

    Data type for holding variation data. Registered OpenType variation-axis tags are listed in OpenType Axis Tag Registry.

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    tag: string

    The tag of the variation-axis name.

    value: number

    The value of the variation axis.

    Methods

    • Converts the variation to a string in the format understood by Variation.fromString.

      Note that the string won't include any whitespace.

      Returns string

      The variation string.

    • Internal

      Write this variation into the given hb_variation_t pointer.

      Parameters

      • ptr: number

      Returns void

    • Parses a string into a Variation.

      The format for specifying variation settings follows. All valid CSS font-variation-settings values other than normal and inherited are also accepted, though, not documented below.

      The format is a tag, optionally followed by an equals sign, followed by a number. For example wght=500, or slnt=-7.5.

      Parameters

      • str: string

        The string to parse.

      Returns Variation | undefined

      A Variation, or undefined if the string is not a valid variation.