Add the Neutral template family, template picker and text-only logo allowances

Linea (the vendor's original format.pdf design), Monogram and Serenity are
rebuilt from the Canva PDFs as one parametric family on the engine, with
the user's logo in the measured slot, a home for every GST field and
A4/Letter support. Adds static Montserrat, Open Sans and Poppins fonts and
a generated Ms Madi outline for Serenity's vertical word. Text-only logo
placeholders (Monolith, Tangerine) use a doc-derived allowance box. A
Carbon TemplatePicker with committed thumbnails opens from the page
setup controls.
This commit is contained in:
2026-10-04 07:27:12 +05:30
parent 86aaa1a790
commit 04d92aa149
61 changed files with 3278 additions and 110 deletions
+4 -1
View File
@@ -12,12 +12,15 @@ const goodFont = () => {
};
describe("font manifest", () => {
it("lists the four bundled families", () => {
it("lists the bundled families", () => {
expect(FONT_FAMILIES).toEqual([
"IBM Plex Mono",
"IBM Plex Sans",
"Montserrat",
"Noto Sans Devanagari",
"Noto Sans Kannada",
"Open Sans",
"Poppins",
]);
for (const fam of FONT_MANIFEST.families) expect(fam.license).toBe("OFL-1.1");
});
+11 -2
View File
@@ -3,9 +3,10 @@
* on the same node as fontSize. Roles used by render-prop text (page numbers) have no leading, because
* react-pdf multiplies a render-prop lineHeight again on every relayout.
*
* These values are the Classic template's; other templates will pass their own token objects.
* TYPE_ROLES holds Classic's values. Every other template declares its own role table (see
* defineRoles) from the faces below and passes those tokens wherever a role is accepted.
*/
export type FaceKey = "IBM Plex Sans" | "IBM Plex Mono";
export type FaceKey = "IBM Plex Sans" | "IBM Plex Mono" | "Montserrat" | "Open Sans" | "Poppins";
export interface TypeToken {
face: FaceKey;
@@ -44,6 +45,14 @@ export const TYPE_ROLES = {
export type RoleName = keyof typeof TYPE_ROLES;
/** A template's own role table: names to tokens. `satisfies`-friendly, so each template keeps its literal keys. */
export type RoleTable<K extends string = string> = Record<K, TypeToken>;
/** Checks a role table against TypeToken and keeps its literal keys: `export const ROLES = defineRoles({ ... })`. */
export function defineRoles<const T extends Record<string, TypeToken>>(table: T): T {
return table;
}
/**
* Licensed template faces (Now, Gotham, Open Sauce One, ...) map to the OFL look-alike that is
* actually bundled. Empty until those families are registered.