Resource card cover: long words are truncated/clipped in the preview #23

Closed
opened 2026-07-09 09:46:29 +00:00 by laoc · 1 comment
Owner

On generated resource card covers, long words are clipped horizontally instead of wrapping or shrinking. Screenshot:

truncated cover titles

In the screenshot "verantwortlich" renders as "verantwortlic" and "Verantwortung" as "Verantwortu" (feed cards from @Fortbildung_Religion).

Likely cause: the cover title typography uses a fixed font size with overflow: hidden and no hyphenation/overflow-wrap: anywhere/font scaling for long German compound words.

Expected: full words visible — wrap with hyphenation (hyphens: auto with lang="de") and/or scale the font down so the longest word fits.

On generated resource card covers, long words are clipped horizontally instead of wrapping or shrinking. Screenshot: ![truncated cover titles](https://git.edufeed.org/attachments/720c4d88-afd9-49de-859f-00fb880f72f1) In the screenshot "verantwortlich" renders as "verantwortlic" and "Verantwortung" as "Verantwortu" (feed cards from @Fortbildung_Religion). Likely cause: the cover title typography uses a fixed font size with `overflow: hidden` and no hyphenation/`overflow-wrap: anywhere`/font scaling for long German compound words. Expected: full words visible — wrap with hyphenation (`hyphens: auto` with `lang="de"`) and/or scale the font down so the longest word fits.
Author
Owner

Fixed on branch fix/issue-23-cover-truncation, merged into dev (e70d1fb0).

Root cause: the cover title font sizes scaled only with container width (cqi) and ignored word length, so long German compounds overflowed the card's overflow: hidden and got clipped.

Fix: each title line now exports its longest-word length as a CSS custom prop and the CSS caps the font size with min(ideal, budget / wordLength) — long words shrink to fit instead of clipping. Titles with pathological words (> 16 chars, e.g. „Donaudampfschifffahrtsgesellschaft“) route to the long-headline layout which wraps instead. Verified in the browser with the exact titles from the screenshot — „verantwortlich“ and „Verantwortung“ now render fully.

Fixed on branch `fix/issue-23-cover-truncation`, merged into `dev` (e70d1fb0). Root cause: the cover title font sizes scaled only with container width (`cqi`) and ignored word length, so long German compounds overflowed the card's `overflow: hidden` and got clipped. Fix: each title line now exports its longest-word length as a CSS custom prop and the CSS caps the font size with `min(ideal, budget / wordLength)` — long words shrink to fit instead of clipping. Titles with pathological words (> 16 chars, e.g. „Donaudampfschifffahrtsgesellschaft“) route to the long-headline layout which wraps instead. Verified in the browser with the exact titles from the screenshot — „verantwortlich“ and „Verantwortung“ now render fully.
laoc closed this issue 2026-07-09 20:43:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
edufeed/edufeed-app#23
No description provided.