Function

HarfBuzz-0.0HarfBuzzot_layout_lookup_collect_glyph_alternatesSince 12.1.0

  • Collects alternates of glyphs from a given GSUB lookup index.

    For one-to-one GSUB glyph substitutions, this function collects the substituted glyph.

    For lookups that assign multiple alternates to a glyph, all alternate glyphs are collected.

    For other lookup types, nothing is performed and false is returned.

    The alternate_count mapping will contain the number of alternates for each glyph id. Upon entry, this mapping should contain the glyph ids as keys, and the number of alternates currently known for each glyph id as values.

    The alternate_glyphs mapping will contain the alternate glyph ids for each glyph id. The mapping is encoded in the following way, upon entry and after processing: If G is the glyph id, and A0, A1, ..., A(n-1) are the alternate glyph ids, the mapping will contain the following entries: (G + (i << 24)) -> A(i) for i = 0, 1, ..., n-1 where n is the number of alternates for G as per alternate_count.

    Parameters

    • face: face_t

      a face.

    • lookup_index: number

      index of the feature lookup to query.

    • alternate_count: map_t

      mapping from glyph index to number of alternates for that glyph.

    • alternate_glyphs: map_t

      mapping from encoded glyph index and alternate index, to alternate glyph ids.

    Returns [number, map_t, map_t]

    true if alternates were collected, false otherwise.

    12.1.0