From b29e70ed98792e277298d7db3afafe99357649b4 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Wed, 21 Oct 2026 13:21:32 +0200 Subject: [PATCH] Reset the alpha of colored Type3 glyphs in the glyph's graphics state --- src/display/canvas.js | 2 +- test/pdfs/.gitignore | 1 + test/pdfs/type3_d0_alpha.pdf | Bin 0 -> 1003 bytes test/test_manifest.json | 8 ++++++++ 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 test/pdfs/type3_d0_alpha.pdf diff --git a/src/display/canvas.js b/src/display/canvas.js index 6bc9b4f48eec4..6ca42a0f3f607 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -3079,7 +3079,7 @@ class CanvasGraphics { this.save(); // Reset inherited alpha for colored (d0) glyphs (issue 21430). if (operatorList.fnArray[0] === OPS.setCharWidth) { - current.fillAlpha = current.strokeAlpha = 1; + this.current.fillAlpha = this.current.strokeAlpha = 1; ctx.globalAlpha = 1; } ctx.scale(fontSize, fontSize); diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index 2dfa3e64b517c..6cdc459821b50 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -975,3 +975,4 @@ !crypt_filters.pdf !bug2082236.pdf !autoprint_will_print.pdf +!type3_d0_alpha.pdf diff --git a/test/pdfs/type3_d0_alpha.pdf b/test/pdfs/type3_d0_alpha.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2dcb254fc980d06b46d8d9f3ac312b475a2efe59 GIT binary patch literal 1003 zcmZWo!EWL(5WVLs=7O|)D7Fb9tW+VD7C3CHMI_Q5P!BF~LMj?pj?uFF^*b|83N3*s z_M11JnfK(u`eAvahH0cgf_-_7Zf`;4f8Py=d+qhXRv^~8GA)dduz}euGEG55+J8<6 zJn^$GTG+-!f5ubnvGJfT5-D<>NM)QsYN#WgOi}B(J;7EYeL8XDPv`MsNT@qPDR7SgtlYx5L;DeF-*@_Gn#%7% z#gay8y)*hP5>&Bjqj`>^#W0qTm)I+)1Xl%oyZa9LD=czWSAnZQby1|^-x(+)noq%I z1xmsn&cu3#5csGsHoxn_?~zUYeRZGh>%F2D`msB&;`G8Q9#BFNq+~H!_TXUL&6LSFY^lS!OF31{pFa15F=mQ1fOrO+FCE_kEqH8!5$Fkg77!fVrG-s$>a h9N*Qf{%0V?dtohIv+j