mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-24 09:08:07 +02:00
Add the font Linux Libertine as a possible substitution for Times New Roman
and try to load the font family (guessed from the font name) before trying the local substitution. The local(...) command expects to have a real font name and not a predefined substitution it's why we try the font family.
This commit is contained in:
parent
51413be5b6
commit
10389c5017
2 changed files with 68 additions and 14 deletions
|
@ -40,7 +40,7 @@ describe("getFontSubstitution", function () {
|
|||
},
|
||||
})
|
||||
);
|
||||
expect(fontSubstitution.css).toMatch(/^g_d(\d+)_sf(\d+)$/);
|
||||
expect(fontSubstitution.css).toMatch(/^"Foo",g_d(\d+)_sf(\d+)$/);
|
||||
});
|
||||
|
||||
it("should substitute an unknown bold font", () => {
|
||||
|
@ -63,7 +63,7 @@ describe("getFontSubstitution", function () {
|
|||
},
|
||||
})
|
||||
);
|
||||
expect(fontSubstitution.css).toMatch(/^g_d(\d+)_sf(\d+)$/);
|
||||
expect(fontSubstitution.css).toMatch(/^"Foo",g_d(\d+)_sf(\d+)$/);
|
||||
});
|
||||
|
||||
it("should substitute an unknown italic font", () => {
|
||||
|
@ -86,7 +86,7 @@ describe("getFontSubstitution", function () {
|
|||
},
|
||||
})
|
||||
);
|
||||
expect(fontSubstitution.css).toMatch(/^g_d(\d+)_sf(\d+)$/);
|
||||
expect(fontSubstitution.css).toMatch(/^"Foo",g_d(\d+)_sf(\d+)$/);
|
||||
});
|
||||
|
||||
it("should substitute an unknown bold italic font", () => {
|
||||
|
@ -109,7 +109,7 @@ describe("getFontSubstitution", function () {
|
|||
},
|
||||
})
|
||||
);
|
||||
expect(fontSubstitution.css).toMatch(/^g_d(\d+)_sf(\d+)$/);
|
||||
expect(fontSubstitution.css).toMatch(/^"Foo",g_d(\d+)_sf(\d+)$/);
|
||||
});
|
||||
|
||||
it("should substitute an unknown font but with a standard font", () => {
|
||||
|
@ -140,7 +140,7 @@ describe("getFontSubstitution", function () {
|
|||
},
|
||||
})
|
||||
);
|
||||
expect(fontSubstitution.css).toMatch(/^g_d(\d+)_sf(\d+),sans-serif$/);
|
||||
expect(fontSubstitution.css).toMatch(/^"Foo",g_d(\d+)_sf(\d+),sans-serif$/);
|
||||
});
|
||||
|
||||
it("should substitute an unknown font but with a standard italic font", () => {
|
||||
|
@ -173,7 +173,7 @@ describe("getFontSubstitution", function () {
|
|||
},
|
||||
})
|
||||
);
|
||||
expect(fontSubstitution.css).toMatch(/^g_d(\d+)_sf(\d+),sans-serif$/);
|
||||
expect(fontSubstitution.css).toMatch(/^"Foo",g_d(\d+)_sf(\d+),sans-serif$/);
|
||||
});
|
||||
|
||||
it("should substitute an unknown font but with a standard bold font", () => {
|
||||
|
@ -205,7 +205,7 @@ describe("getFontSubstitution", function () {
|
|||
},
|
||||
})
|
||||
);
|
||||
expect(fontSubstitution.css).toMatch(/^g_d(\d+)_sf(\d+),sans-serif$/);
|
||||
expect(fontSubstitution.css).toMatch(/^"Foo",g_d(\d+)_sf(\d+),sans-serif$/);
|
||||
});
|
||||
|
||||
it("should substitute an unknown font but with a standard bold italic font", () => {
|
||||
|
@ -240,7 +240,7 @@ describe("getFontSubstitution", function () {
|
|||
},
|
||||
})
|
||||
);
|
||||
expect(fontSubstitution.css).toMatch(/^g_d(\d+)_sf(\d+),sans-serif$/);
|
||||
expect(fontSubstitution.css).toMatch(/^"Foo",g_d(\d+)_sf(\d+),sans-serif$/);
|
||||
});
|
||||
|
||||
it("should substitute Calibri", () => {
|
||||
|
@ -271,7 +271,9 @@ describe("getFontSubstitution", function () {
|
|||
},
|
||||
})
|
||||
);
|
||||
expect(fontSubstitution.css).toMatch(/^g_d(\d+)_sf(\d+),sans-serif$/);
|
||||
expect(fontSubstitution.css).toMatch(
|
||||
/^"Calibri",g_d(\d+)_sf(\d+),sans-serif$/
|
||||
);
|
||||
});
|
||||
|
||||
it("should substitute Calibri-Bold", () => {
|
||||
|
@ -304,7 +306,9 @@ describe("getFontSubstitution", function () {
|
|||
},
|
||||
})
|
||||
);
|
||||
expect(fontSubstitution.css).toMatch(/^g_d(\d+)_sf(\d+),sans-serif$/);
|
||||
expect(fontSubstitution.css).toMatch(
|
||||
/^"Calibri",g_d(\d+)_sf(\d+),sans-serif$/
|
||||
);
|
||||
});
|
||||
|
||||
it("should substitute Arial Black", () => {
|
||||
|
@ -337,7 +341,9 @@ describe("getFontSubstitution", function () {
|
|||
},
|
||||
})
|
||||
);
|
||||
expect(fontSubstitution.css).toMatch(/^g_d(\d+)_sf(\d+),sans-serif$/);
|
||||
expect(fontSubstitution.css).toMatch(
|
||||
/^"ArialBlack",g_d(\d+)_sf(\d+),sans-serif$/
|
||||
);
|
||||
});
|
||||
|
||||
it("should substitute Arial Black Bold", () => {
|
||||
|
@ -370,6 +376,8 @@ describe("getFontSubstitution", function () {
|
|||
},
|
||||
})
|
||||
);
|
||||
expect(fontSubstitution.css).toMatch(/^g_d(\d+)_sf(\d+),sans-serif$/);
|
||||
expect(fontSubstitution.css).toMatch(
|
||||
/^"ArialBlack",g_d(\d+)_sf(\d+),sans-serif$/
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue