Skip to content

Open source CapCut alternative.

TypeScript

feat(site): add Libre Caslon Display to the Cut fonts [rebuild]

David Le3ccc350f124f
diff --git a/site/package-lock.json b/site/package-lock.json
index 1465ebee..1cd1fbd8 100644
--- a/site/package-lock.json
+++ b/site/package-lock.json
@@ -46,6 +46,7 @@
"@fontsource/jost": "^5.3.0",
"@fontsource/kaushan-script": "^5.3.0",
"@fontsource/libre-caslon-condensed": "^5.3.1",
+ "@fontsource/libre-caslon-display": "^5.3.0",
"@fontsource/lobster": "^5.3.0",
"@fontsource/montserrat": "^5.3.0",
"@fontsource/noto-serif": "^5.3.0",
@@ -2359,6 +2360,15 @@
"url": "https://github.com/sponsors/ayuhito"
}
},
+ "node_modules/@fontsource/libre-caslon-display": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/libre-caslon-display/-/libre-caslon-display-5.3.0.tgz",
+ "integrity": "sha512-WZEyiWTKBoXHWHNfdFQcexxmUOQ22XpSK4ivzczY2AnSt/u8DfmzRpYX6eKwUaFjva5BhSbUUArmouHTDwSEFQ==",
+ "license": "OFL-1.1",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
+ }
+ },
"node_modules/@fontsource/lobster": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/@fontsource/lobster/-/lobster-5.3.0.tgz",
diff --git a/site/package.json b/site/package.json
index 46f1f6dd..3ff22e88 100644
--- a/site/package.json
+++ b/site/package.json
@@ -87,6 +87,7 @@
"@fontsource/jost": "^5.3.0",
"@fontsource/kaushan-script": "^5.3.0",
"@fontsource/libre-caslon-condensed": "^5.3.1",
+ "@fontsource/libre-caslon-display": "^5.3.0",
"@fontsource/lobster": "^5.3.0",
"@fontsource/montserrat": "^5.3.0",
"@fontsource/noto-serif": "^5.3.0",
diff --git a/site/src/cut/lib/fixtures/serif-photo-29.webp b/site/src/cut/lib/fixtures/serif-photo-29.webp
new file mode 100644
index 00000000..87c97321
Binary files /dev/null and b/site/src/cut/lib/fixtures/serif-photo-29.webp differ
diff --git a/site/src/cut/lib/fontMatch.test.ts b/site/src/cut/lib/fontMatch.test.ts
index 541636fa..337e0d54 100644
--- a/site/src/cut/lib/fontMatch.test.ts
+++ b/site/src/cut/lib/fontMatch.test.ts
@@ -191,4 +191,15 @@ describe("faces off a reference frame", () => {
expect(ranked[0].score).toBeGreaterThanOrEqual(good);
expect(ranked.find((m) => m.font === "anton")!.score).toBeLessThan(ranked[0].score);
});
+
+ test("a recap template's small display serif ranks Libre Caslon Display over Playfair", async () => {
+ // "photo 29" in warm grey over peach, 41 px tall in a 576 px frame: a
+ // thin Caslon-style display serif. Before Libre Caslon Display was
+ // bundled the closest serif was Playfair Display, far wider and with a
+ // taller x-height, at 0.29.
+ const ranked = await rankFaces(await frameInk("serif-photo-29.webp"), "photo 29", catalog, fontStack);
+ const caslon = ranked.find((m) => m.font === "libre-caslon-display")!;
+ const playfair = ranked.find((m) => m.font === "playfair")!;
+ expect(caslon.score).toBeGreaterThan(playfair.score + 0.1);
+ });
});
diff --git a/site/src/cut/lib/fonts.json b/site/src/cut/lib/fonts.json
index 63e7a306..7829a14e 100644
--- a/site/src/cut/lib/fonts.json
+++ b/site/src/cut/lib/fonts.json
@@ -69,6 +69,13 @@
"weights": [700],
"note": "Bold only: the tall condensed face of a lyric template's big words."
},
+ {
+ "id": "libre-caslon-display",
+ "kind": "serif",
+ "look": "thin high-contrast Caslon display serif",
+ "family": "Libre Caslon Display",
+ "weights": [400]
+ },
{
"family": "Roboto",
"weights": [400, 500, 600, 700],