1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Remove the tag for missing font subset when trying to find a substitution

Fixes #17929.
This commit is contained in:
Calixte Denizet 2024-04-11 17:55:11 +02:00
parent f3b03e5c4b
commit 52ea2333b3
6 changed files with 71 additions and 15 deletions

View file

@ -641,3 +641,4 @@
!issue17871_bottom_right.pdf
!issue17871_top_right.pdf
!bug1889122.pdf
!issue17929.pdf

BIN
test/pdfs/issue17929.pdf Executable file

Binary file not shown.

View file

@ -9833,5 +9833,12 @@
"firstPage": 1,
"lastPage": 1,
"type": "eq"
},
{
"id": "issue17929",
"file": "pdfs/issue17929.pdf",
"md5": "2f5686f77f73fb99037f5c2c7e48ce53",
"rounds": 1,
"type": "eq"
}
]

View file

@ -27,7 +27,32 @@ describe("getFontSubstitution", function () {
idFactory,
localFontPath,
fontName,
undefined
undefined,
"TrueType"
);
expect(fontSubstitution).toEqual(
jasmine.objectContaining({
guessFallback: true,
baseFontName: "Foo",
src: "local(Foo)",
style: {
style: "normal",
weight: "normal",
},
})
);
expect(fontSubstitution.css).toMatch(/^"Foo",g_d(\d+)_sf(\d+)$/);
});
it("should substitute an unknown font subset", () => {
const fontName = "ABCDEF+Foo";
const fontSubstitution = getFontSubstitution(
new Map(),
idFactory,
localFontPath,
fontName,
undefined,
"TrueType"
);
expect(fontSubstitution).toEqual(
jasmine.objectContaining({
@ -50,7 +75,8 @@ describe("getFontSubstitution", function () {
idFactory,
localFontPath,
fontName,
undefined
undefined,
"TrueType"
);
expect(fontSubstitution).toEqual(
jasmine.objectContaining({
@ -73,7 +99,8 @@ describe("getFontSubstitution", function () {
idFactory,
localFontPath,
fontName,
undefined
undefined,
"TrueType"
);
expect(fontSubstitution).toEqual(
jasmine.objectContaining({
@ -96,7 +123,8 @@ describe("getFontSubstitution", function () {
idFactory,
localFontPath,
fontName,
undefined
undefined,
"TrueType"
);
expect(fontSubstitution).toEqual(
jasmine.objectContaining({
@ -119,7 +147,8 @@ describe("getFontSubstitution", function () {
idFactory,
localFontPath,
fontName,
"Helvetica"
"Helvetica",
"TrueType"
);
expect(fontSubstitution).toEqual(
jasmine.objectContaining({
@ -150,7 +179,8 @@ describe("getFontSubstitution", function () {
idFactory,
localFontPath,
fontName,
"Helvetica-Oblique"
"Helvetica-Oblique",
"TrueType"
);
expect(fontSubstitution).toEqual(
jasmine.objectContaining({
@ -183,7 +213,8 @@ describe("getFontSubstitution", function () {
idFactory,
localFontPath,
fontName,
"Helvetica-Bold"
"Helvetica-Bold",
"TrueType"
);
expect(fontSubstitution).toEqual(
jasmine.objectContaining({
@ -215,7 +246,8 @@ describe("getFontSubstitution", function () {
idFactory,
localFontPath,
fontName,
"Helvetica-BoldOblique"
"Helvetica-BoldOblique",
"TrueType"
);
expect(fontSubstitution).toEqual(
jasmine.objectContaining({
@ -250,7 +282,8 @@ describe("getFontSubstitution", function () {
idFactory,
localFontPath,
fontName,
undefined
undefined,
"TrueType"
);
expect(fontSubstitution).toEqual(
jasmine.objectContaining({
@ -283,7 +316,8 @@ describe("getFontSubstitution", function () {
idFactory,
localFontPath,
fontName,
undefined
undefined,
"TrueType"
);
expect(fontSubstitution).toEqual(
jasmine.objectContaining({
@ -318,7 +352,8 @@ describe("getFontSubstitution", function () {
idFactory,
localFontPath,
fontName,
undefined
undefined,
"TrueType"
);
expect(fontSubstitution).toEqual(
jasmine.objectContaining({
@ -353,7 +388,8 @@ describe("getFontSubstitution", function () {
idFactory,
localFontPath,
fontName,
undefined
undefined,
"TrueType"
);
expect(fontSubstitution).toEqual(
jasmine.objectContaining({