Function

HarfBuzz-0.0HarfBuzzfont_paint_glyph_or_failSince 11.2.0

  • Paints a color glyph.

    Succeeds if glyph has color paint layers (COLRv0), a color paint graph (COLRv1), or a bitmap image that the font's callbacks render successfully. Returns false if the font has no color data for glyph; the client can then fall back to hb_font_draw_glyph_or_fail() for the monochrome outline.

    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: null

      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