Merge e96a1c9dbe9f555276734b133ca7f21d8892f99f into ec71e4ed651e659b06a4fa46ef0b18ff9ab2a8c7

This commit is contained in:
maettuu 2025-11-25 15:21:08 -05:00 committed by GitHub
commit c3d4ac2fea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
});
});