harfbuzzjs
    Preparing search index...

    Type Alias PaintImageFunc

    PaintImageFunc: (
        image: Uint8Array,
        width: number,
        height: number,
        format: string,
        extents: GlyphExtents | undefined,
        paintData: unknown,
        userData: unknown,
    ) => boolean

    A callback to paint a glyph image.

    This method is called for glyphs with image blobs in the CBDT, sbix or SVG tables. The format identifies the kind of data that is contained in image. Possible values include "png ", "svg " and "BGRA".

    The image dimensions and glyph extents are provided if available, and should be used to size and position the image.

    Type Declaration

      • (
            image: Uint8Array,
            width: number,
            height: number,
            format: string,
            extents: GlyphExtents | undefined,
            paintData: unknown,
            userData: unknown,
        ): boolean
      • Parameters

        • image: Uint8Array

          the image data

        • width: number

          width of the raster image in pixels, or 0

        • height: number

          height of the raster image in pixels, or 0

        • format: string

          the image format as a tag

        • extents: GlyphExtents | undefined

          glyph extents for desired rendering

        • paintData: unknown

          the data accompanying the paint functions in Font.paintGlyph

        • userData: unknown

          the user data pointer passed to PaintFuncs.setImageFunc

        Returns boolean

        Whether the operation was successful.