mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-23 16:35:47 +02:00
Reset alpha before drawing a colored glyph in type 3 font
It fixes #21430.
This commit is contained in:
parent
8ebc2382e3
commit
623e6d9476
@ -2965,6 +2965,14 @@ class CanvasGraphics {
|
|||||||
warn(`Type3 character "${glyph.operatorListId}" is not available.`);
|
warn(`Type3 character "${glyph.operatorListId}" is not available.`);
|
||||||
} else if (this.contentVisible) {
|
} else if (this.contentVisible) {
|
||||||
this.save();
|
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.scale(fontSize, fontSize);
|
||||||
ctx.transform(...fontMatrix);
|
ctx.transform(...fontMatrix);
|
||||||
this.executeOperatorList(operatorList);
|
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",
|
"type": "eq",
|
||||||
"annotations": true,
|
"annotations": true,
|
||||||
"forms": 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