Function

HarfBuzz-0.0HarfBuzzfont_paint_glyph_or_failSince 11.2.0

  • Paints a color glyph.

    This function is similar to, but lower-level than, hb_font_paint_glyph(). It is suitable for clients that need more control. If there are no color glyphs available, it will return false. The client can then fall back to hb_font_draw_glyph_or_fail() for the monochrome outline glyph.

    The painting instructions are returned by way of calls to the callbacks of the funcs object, with paint_data passed to them.

    If the font has color palettes (see hb_ot_color_has_palettes()), then palette_index selects the palette to use. If the font only has one palette, this will be 0.

    Parameters

    • font: font_t

      HarfBuzz.font_t to work upon

    • glyph: number

      The glyph ID

    • pfuncs: paint_funcs_t

      HarfBuzz.paint_funcs_t to paint with

    • paint_data: any

      User data to pass to paint callbacks

    • palette_index: number

      The index of the font's color palette to use

    • foreground: number

      The foreground color, unpremultipled

    Returns number

    true if glyph was painted, false otherwise

    11.2.0