v1.1.7

Color

A COLR glyph renders to a scene rather than a coverage map, since it has more than one color in it.

let scene = font.render_colr_glyph(gid, 48.0, &[], 0).expect("is a color glyph");
scene.width;
scene.height;
scene.rgba;   // straight alpha RGBA8

Both COLR versions render here: v1 walks its paint graph, so gradients, transforms and compositing resolve, and v0 fills its flat stack of layers back to front. The palette index selects among CPAL palettes.

A layer may defer to your text color rather than name a palette entry. The plain call paints those opaque black; render_colr_glyph_with takes the color instead, andgpu_color_glyph_with and draw_glyph_with do the same on their paths.

colr_v1_paint hands back the paint graph itself if you would rather walk it, andcolr_layers gives the v0 layer list.

Type to search.