From 6d4ceefbdfd13eeaf618be72af41e841e2f38729 Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Wed, 30 Sep 2026 01:07:33 +0200 Subject: [PATCH] fix(pdf): honor soft hyphens for every hyphenated language Forme hyphenates every language it has patterns for, so drop the German-only gate on soft-hyphen decoding and the "Currently supports German" schema note. --- docs/guides/json-resume-schema.mdx | 2 +- docs/spec.json | 38 +++++++++---------- .../pdf/src/templates/shared/rich-text.tsx | 2 +- packages/schema/src/resume/data.ts | 4 +- skills/resume-builder/references/schema.md | 2 +- 5 files changed, 23 insertions(+), 25 deletions(-) diff --git a/docs/guides/json-resume-schema.mdx b/docs/guides/json-resume-schema.mdx index dfdcb8ae4..1f3a7fc4b 100644 --- a/docs/guides/json-resume-schema.mdx +++ b/docs/guides/json-resume-schema.mdx @@ -4707,7 +4707,7 @@ The full JSON Schema for Reactive Resume follows. You can also fetch the latest "description": "The typography for the headings of the resume." }, "hyphenation": { - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false.", + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false.", "type": "boolean" } }, diff --git a/docs/spec.json b/docs/spec.json index 4941d45f2..b5d2b7589 100644 --- a/docs/spec.json +++ b/docs/spec.json @@ -10289,7 +10289,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -11032,7 +11032,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -11690,7 +11690,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -12056,7 +12056,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -12701,7 +12701,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -13442,7 +13442,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -14117,7 +14117,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -14775,7 +14775,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -15373,7 +15373,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -15966,7 +15966,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -16828,7 +16828,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -17586,7 +17586,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -23300,7 +23300,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -27674,7 +27674,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -32183,7 +32183,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -36663,7 +36663,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -41610,7 +41610,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -46069,7 +46069,7 @@ }, "hyphenation": { "type": "boolean", - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false." + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false." } }, "required": [ @@ -50895,7 +50895,7 @@ "description": "The typography for the headings of the resume." }, "hyphenation": { - "description": "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false.", + "description": "Enable automatic PDF hyphenation using the resume language. Defaults to false.", "type": "boolean" } }, diff --git a/packages/pdf/src/templates/shared/rich-text.tsx b/packages/pdf/src/templates/shared/rich-text.tsx index fc3f93155..9fcb6bf6b 100644 --- a/packages/pdf/src/templates/shared/rich-text.tsx +++ b/packages/pdf/src/templates/shared/rich-text.tsx @@ -98,7 +98,7 @@ export const RichText = ({ children, semanticField }: RichTextProps) => { const normalizedHtml = normalizeRichTextHtml(children, { direction: rtl ? "rtl" : "ltr", - softHyphens: metadata.typography.hyphenation === true && /^de(?:-|$)/i.test(metadata.page.locale), + softHyphens: metadata.typography.hyphenation === true, }); const html = richTextNodeKey ? projectNormalizedRichTextHtml(normalizedHtml, richTextNodeKey, renderedChildKeysFor) diff --git a/packages/schema/src/resume/data.ts b/packages/schema/src/resume/data.ts index 4f3e215d9..aae56a20f 100644 --- a/packages/schema/src/resume/data.ts +++ b/packages/schema/src/resume/data.ts @@ -598,9 +598,7 @@ export const typographySchema = z.object({ hyphenation: z .boolean() .optional() - .describe( - "Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false.", - ), + .describe("Enable automatic PDF hyphenation using the resume language. Defaults to false."), }); const styleSlotSchema = z.enum([ diff --git a/skills/resume-builder/references/schema.md b/skills/resume-builder/references/schema.md index 1aa64a4ff..aed4060da 100644 --- a/skills/resume-builder/references/schema.md +++ b/skills/resume-builder/references/schema.md @@ -875,7 +875,7 @@ Choose one coherent shape for each union value. Required fields are local to tha | `metadata.typography.heading.fontWeights[]` | `string` | — | enum: ["100","200","300","400","500","600","700","800","900"] | — | | `metadata.typography.heading.fontSize` | `number` | yes | minimum: 6; maximum: 24; default: 11 | The size of the font to use, defined in points (pt). | | `metadata.typography.heading.lineHeight` | `number` | yes | minimum: 0.5; maximum: 4; default: 1.5 | The line height of the font to use, defined as a multiplier of the font size (e.g. 1.5 for 1.5x). | -| `metadata.typography.hyphenation` | `boolean` | no | — | Enable automatic PDF hyphenation using the resume language. Currently supports German. Defaults to false. | +| `metadata.typography.hyphenation` | `boolean` | no | — | Enable automatic PDF hyphenation using the resume language. Defaults to false. | | `metadata.notes` | `string` | yes | — | Personal notes for the resume. Can be used to add any additional information or instructions for the resume. These notes are not displayed on the resume, they are only visible to the author of the resume when editing the resume. This should be a HTML-formatted string. | | `metadata.styleRules` | `array` | yes | — | Structured style rules that target semantic resume sections and slots for PDF rendering. | | `metadata.styleRules[]` | `any` | — | — | — |