[Pixman] font rendering

Ben Avison bavison at riscosopen.org
Thu Mar 7 08:54:21 PST 2013


Hi Gerd,

> Is there documentation somewhere describing what the pixman ops exactly do?

Pixman isn't great at documentation, I'm afraid. Seems to be a matter of
"use the source" :(

As far as I'm aware, the terminology for operation names was coined in a
paper by Porter & Duff. You might find the following useful:

http://en.wikipedia.org/wiki/Alpha_compositing
http://cairographics.org/operators/

>   (2) The vgafont glyph, in PIXMAN_a8r8g8b8,
>       with 0xffffffff / 0x00000000 for font/background pixels.

I suspect you could equally have used PIXMAN_a8, or even PIXMAN_a1 if
you only want a binary mask.

>     pixman_image_composite(PIXMAN_OP_SRC, bg, NULL, vgafb, ...);
>     pixman_image_composite(PIXMAN_OP_OVER, fg, glyph, vgafb, ...);
>
> So the first op fills with the background color, and the second renders
> the character.  Comes close to what I want.  Except that the second
> blends the foreground color with the background color instead of
> replacing it.

At first glance that looks valid to me. Are you sure you've set the
alpha bits correctly in the solid foreground colour? The actual alpha
used is the product of this with the alpha from the mask image.

Ben


More information about the Pixman mailing list