mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-23 08:25:48 +02:00
Merge pull request #21483 from calixteman/issue21430
Reset alpha before drawing a colored glyph in type 3 font
This commit is contained in:
commit
7ac6dff4b7
@ -2965,6 +2965,14 @@ class CanvasGraphics {
|
||||
warn(`Type3 character "${glyph.operatorListId}" is not available.`);
|
||||
} else if (this.contentVisible) {
|
||||
this.save();
|
||||
// A d0 (setCharWidth) glyph is colored (see Table 113 in pdf 1.7 specs)
|
||||
// unlike a d1 glyph painted as a stencil mask with the current fill
|
||||
// color. The constant alphas (ca/CA) are the opacity of that current
|
||||
// color, so they must not attenuate a d0 glyph.
|
||||
if (operatorList.fnArray[0] === OPS.setCharWidth) {
|
||||
current.fillAlpha = current.strokeAlpha = 1;
|
||||
ctx.globalAlpha = 1;
|
||||
}
|
||||
ctx.scale(fontSize, fontSize);
|
||||
ctx.transform(...fontMatrix);
|
||||
this.executeOperatorList(operatorList);
|
||||
|
||||
1
test/pdfs/issue21430.pdf.link
Normal file
1
test/pdfs/issue21430.pdf.link
Normal file
@ -0,0 +1 @@
|
||||
https://github.com/user-attachments/files/28821514/xxx.pdf
|
||||
@ -14429,5 +14429,15 @@
|
||||
"type": "eq",
|
||||
"annotations": true,
|
||||
"forms": true
|
||||
},
|
||||
{
|
||||
"id": "issue21430",
|
||||
"file": "pdfs/issue21430.pdf",
|
||||
"md5": "e317f63bdfd6f3d1939a52c983379454",
|
||||
"rounds": 1,
|
||||
"link": true,
|
||||
"firstPage": 1,
|
||||
"lastPage": 1,
|
||||
"type": "eq"
|
||||
}
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user