Invalid font rendering
This is with default GTK 4.12:
/* wrong */
opacity {
opacity: 0.4;
child: text {
color: black;
font: "Noto Sans Arabic 10";
glyphs: 418 8, 1505 5, 420 8, 1035 18, 3 3, 986 5, 1503 4, 390 7;
}
}
/* correct */
color-matrix {
matrix: matrix3d(1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 0.4);
child: text {
color: black;
font: "Noto Sans Arabic 10";
glyphs: 418 8, 1505 5, 420 8, 1035 18, 3 3, 986 5, 1503 4, 390 7;
offset: 0 20;
}
}
It looks like this, note the darker parts on the right:
The Cairo and Vulkan renderer handle this properly.
I believe it's because GTK sets offscreen_for_opacity=FALSE
for text nodes when text nodes are in fact a container node and when glyphs overlap (which they rarely do, but it happens with certain fonts and/or languages), then the node does indeed need an offscreen for opacity.
I didn't do an MR just changing that one line, because I believe you primarily invented this code for the text handling case, at which point just ripping it out and deleting it entirely would make sense. But you might also know how to check for overlap?
Anyway, I wanted to discuss this first.
PS: I suspect this is probably seen in the wild because Adwaita uses opacity for dim labels.
PPS: It's probably possible to reproduce with certain kinds of fancy fonts, too - see this blog post for a similar example.