Function

HarfBuzz-0.0HarfBuzzfeature_from_stringSince 0.9.5

  • Parses a string into a HarfBuzz.feature_t.

    The format for specifying feature strings follows. All valid CSS font-feature-settings values other than 'normal' and the global values are also accepted, though not documented below. CSS string escapes are not supported.

    The range indices refer to the positions between Unicode characters. The position before the first character is always 0.

    The format is Python-esque. Here is how it all works:

    Syntax Value Start End Setting value: kern 1 0 Turn feature on +kern 1 0 Turn feature on -kern 0 0 Turn feature off kern=0 0 0 Turn feature off kern=1 1 0 Turn feature on aalt=2 2 0 Choose 2nd alternate Setting index: kern[] 1 0 Turn feature on kern[:] 1 0 Turn feature on kern[5:] 1 5 Turn feature on, partial kern[:5] 1 0 5 Turn feature on, partial kern[3:5] 1 3 5 Turn feature on, range kern[3] 1 3 3+1 Turn feature on, single char Mixing it all: aalt[3:5]=2 2 3 5 Turn 2nd alternate on for range

    Parameters

    • str: string | Uint8Array<ArrayBufferLike>

      a string to parse

    Returns [number, feature_t]

    true if str is successfully parsed, false otherwise

    0.9.5