Pango ignoring alpha attribute / color attribute alpha component
No matter what markup is being rendered, I always get an alpha value of 0
from pango_renderer_get_alpha(renderer, PANGO_RENDER_PART_FOREGROUND)
, where renderer
is an instance of a subclass of PangoRenderer
. Test cases:
Markup
<span color="#0009">Half-transparen</span>
- `Half-transparent
In my code I have:
pango_layout_set_markup(layout, markup, markup_size);
pango_renderer_draw_layout(renderer, layout, 0, 0);
with markup
set to one of the above test strings and markup_size
to the length of markup
. Then in the draw_glyphs
vfunc of my PangoRenderer
subclass, pango_renderer_get_alpha(renderer, PANGO_RENDERER_PART_FOREGROUND)
always returns 0, for each of the three test cases.
However the bug must be somewhere in the attributes handling since pango_color_parse_with_alpha
returns the correct alpha values for color strings of the form #r[r[r[r]]]g[g[g[g]]]b[b[b[b]]]a[a[a[a]]]
I'm using Pango 1.50.6 from my distro (Ubuntu Studio 22.04).