Add regression test for font mapping
Verifies that sans-serif is mapped to Calibri and monospace to Lucida Console on Windows/Firefox See PR https://github.com/mozilla/pdf.js/pull/18844
This commit is contained in:
parent
e9a483014d
commit
e96a1c9dbe
@ -13,9 +13,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { FeatureTest, isNodeJS } from "../../src/shared/util.js";
|
||||
import { buildGetDocumentParams } from "./test_utils.js";
|
||||
import { getDocument } from "../../src/display/api.js";
|
||||
import { isNodeJS } from "../../src/shared/util.js";
|
||||
import { TextLayer } from "../../src/display/text_layer.js";
|
||||
|
||||
describe("textLayer", function () {
|
||||
@ -250,4 +250,21 @@ describe("textLayer", function () {
|
||||
|
||||
await loadingTask.destroy();
|
||||
});
|
||||
|
||||
it("should use Calibri and Lucida Console on Windows with Firefox", async function () {
|
||||
spyOnProperty(FeatureTest, "platform", "get").and.returnValue({
|
||||
isWindows: true,
|
||||
isFirefox: true,
|
||||
});
|
||||
|
||||
const fontFamilyMap = TextLayer.fontFamilyMap;
|
||||
const expectedSansSerif = "Calibri, sans-serif";
|
||||
const expectedMonospace = "Lucida Console, monospace";
|
||||
|
||||
const actualSansSerif = fontFamilyMap.get("sans-serif");
|
||||
const actualMonospace = fontFamilyMap.get("monospace");
|
||||
|
||||
expect(actualSansSerif).toBe(expectedSansSerif);
|
||||
expect(actualMonospace).toBe(expectedMonospace);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user