mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Merge pull request #17930 from calixteman/issue17929
Remove the tag for missing font subset when trying to find a substitution
This commit is contained in:
commit
2d885e2862
6 changed files with 71 additions and 15 deletions
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -641,3 +641,4 @@
|
|||
!issue17871_bottom_right.pdf
|
||||
!issue17871_top_right.pdf
|
||||
!bug1889122.pdf
|
||||
!issue17929.pdf
|
||||
|
|
BIN
test/pdfs/issue17929.pdf
Executable file
BIN
test/pdfs/issue17929.pdf
Executable file
Binary file not shown.
|
@ -9833,5 +9833,12 @@
|
|||
"firstPage": 1,
|
||||
"lastPage": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{
|
||||
"id": "issue17929",
|
||||
"file": "pdfs/issue17929.pdf",
|
||||
"md5": "2f5686f77f73fb99037f5c2c7e48ce53",
|
||||
"rounds": 1,
|
||||
"type": "eq"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue