alexheretic/ab-glyph

Custom font colors

Closed this issue · 4 comments

morn-0 commented

my context: it's based on a tiny-skia pixmap getting pixels_mut for the operation.
Hello, I am trying to customize the rendering color of a font. I've tried a few options and they don't seem to work very well

The ab_glyph rasterizer provides just coverage values for each pixel. You can colour them any way you like.

For instance, the image example colours the glyphs dark red.

morn-0 commented

image
image

use color(150, 0, 0); maybe not work

morn-0 commented

i use tiny-skia

i use tiny-skia

I'm not familiar with that lib myself. But as long you are getting the correct coverage values for the glyphs I don't think this is an issue for ab_glyph.