mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-26 09:21:06 +01:00
The demo fragment shaders were passing u_foreground's brightness to hb_gpu_stem_darken(), which was wrong for color glyphs: a red cheek on an emoji should darken relative to its own red, not to whatever the text-foreground uniform happens to be. Switch all four demo fragment paths (GL, Metal, D3D11, WebGPU) to compute brightness from the fragment's own straight color (c.rgb / c.a). For monochrome glyphs this is identical to the old formula -- the synthesized single layer's color IS the foreground uniform -- so non-color rendering is unchanged. The public hb_gpu_stem_darken() helper is unchanged; only its callers pass a different brightness. Document the paint-path usage in the hb-gpu section. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>