@@ -17,6 +17,7 @@ const inspection: FontInspection = {
|
||||
coverageRangesTruncated: false,
|
||||
coverageBlocks: [],
|
||||
axes: [{ tag: "wght", name: "Weight", min: 200, default: 400, max: 900 }],
|
||||
layout: [],
|
||||
embedding: {
|
||||
raw: 0,
|
||||
rawHex: "0x0000",
|
||||
@@ -52,4 +53,28 @@ describe("safe CSS generation", () => {
|
||||
);
|
||||
expect(() => validateLocalPath("./font\n.woff")).toThrow(/control/u);
|
||||
});
|
||||
|
||||
it("labels collection CSS as non-portable face selection", () => {
|
||||
const result = generateFontFace({
|
||||
family: "Fixture collection face",
|
||||
sourcePath: "./fonts/fixture.ttc",
|
||||
display: "swap",
|
||||
inspection: {
|
||||
...inspection,
|
||||
fileName: "fixture.ttc",
|
||||
container: "collection",
|
||||
collection: {
|
||||
version: "1.0",
|
||||
selectedFace: 0,
|
||||
hasDigitalSignature: false,
|
||||
faces: [],
|
||||
},
|
||||
},
|
||||
includeUnicodeRange: false,
|
||||
});
|
||||
expect(result.css).toContain('format("collection")');
|
||||
expect(result.warnings).toContainEqual(
|
||||
expect.stringMatching(/cannot portably identify/u),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user