1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 06:38:07 +02:00

Use adjustWidths unconditionally for all embedded fonts (issue 19802)

Previously we'd only do this for Type1/CFF fonts, see e.g. PR 6736, since the font-program may update the /FontMatrix.
However, it seems that we should do this unconditionally to account for fonts with non-default /FontMatrix-entries in the font-dictionary (which seem to be pretty rare).
This commit is contained in:
Jonas Jenwald 2025-04-11 14:50:56 +02:00
parent 539a81c7a3
commit 835a456767
4 changed files with 11 additions and 4 deletions

View file

@ -1108,9 +1108,10 @@ class Font {
// Repair the TrueType file. It is can be damaged in the point of // Repair the TrueType file. It is can be damaged in the point of
// view of the sanitizer // view of the sanitizer
data = this.checkAndRepair(name, file, properties); data = this.checkAndRepair(name, file, properties);
if (this.isOpenType) {
adjustWidths(properties);
adjustWidths(properties);
if (this.isOpenType) {
type = "OpenType"; type = "OpenType";
} }
break; break;
@ -2645,8 +2646,6 @@ class Font {
cffFile = new Stream(tables["CFF "].data); cffFile = new Stream(tables["CFF "].data);
cff = new CFFFont(cffFile, properties); cff = new CFFFont(cffFile, properties);
adjustWidths(properties);
return this.convert(name, cff, properties); return this.convert(name, cff, properties);
} }

View file

@ -28,6 +28,7 @@
!checkbox-bad-appearance.pdf !checkbox-bad-appearance.pdf
!issue4684.pdf !issue4684.pdf
!issue8092.pdf !issue8092.pdf
!issue19802.pdf
!issue5256.pdf !issue5256.pdf
!issue5801.pdf !issue5801.pdf
!issue5946.pdf !issue5946.pdf

BIN
test/pdfs/issue19802.pdf Normal file

Binary file not shown.

View file

@ -3871,6 +3871,13 @@
"annotations": true, "annotations": true,
"about": "LinkAnnotation with a relative link, and a /Catalog Base-URI." "about": "LinkAnnotation with a relative link, and a /Catalog Base-URI."
}, },
{
"id": "issue19802",
"file": "pdfs/issue19802.pdf",
"md5": "7a431fb7951ad605f676c80636bbe5d3",
"rounds": 1,
"type": "eq"
},
{ {
"id": "issue14824", "id": "issue14824",
"file": "pdfs/issue14824.pdf", "file": "pdfs/issue14824.pdf",