Skip to content

fix(memo): RU Memo Back overflow — cyrillic font fallbacks + vertical grid auto-fit - #452

Merged
jsboige merged 1 commit into
masterfrom
fix/memo-back-ru-overflow
Jun 10, 2026
Merged

fix(memo): RU Memo Back overflow — cyrillic font fallbacks + vertical grid auto-fit#452
jsboige merged 1 commit into
masterfrom
fix/memo-back-ru-overflow

Conversation

@jsboige

@jsboige jsboige commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Contexte

Verdict QA géométrique 2026-06-10 (recheck master 5ea58c8c, régén Release po-2023) : Mémo Back RU FAIL ×3 — sous-titre wrappé hors du bandeau rouge, polices display en fallback serif, familles 6–7 (Лукавство, Обструкция) coupées en bas de carte. FR/EN/PT = PASS (non touchés). Chemin critique release (fenêtre FABLE, relay 2026-06-10 22:29Z).

Root causes

  1. Typo CSS .header .subtitle { font-family:'Bebas Neue', sans-serit; } — token invalide → fallback navigateur serif pour les glyphes cyrilliques (Bebas Neue est Latin-only).
  2. Stacks display Latin-only sans fallback cyrillique : .subfamily ('Bebas Neue' seul), .subsubfamily ('Dosis' seul) → serif + métriques plus hautes → débordement vertical.
  3. Aucun mécanisme de fit vertical pour la grille taxonomique : les libellés RU plus longs poussent les familles 6–7 hors carte.

Fix (language-invariant, no-op quand ça tient)

Template Argumentum_Memo_Back_fr.json (6 remplacements chirurgicaux, JSON revalidé) :

  • extCSS : + Oswald (display condensé cyrillique) + PT Sans Narrow (corps condensé cyrillique)
  • fix typo sans-seritsans-serif
  • fallbacks cyrilliques : .subtitle/.family/.subfamily'Bebas Neue','Oswald',sans-serif ; .subsubfamily'Dosis','PT Sans Narrow',sans-serif
  • .subtitle : white-space:nowrap + max-width:100% + overflow:hidden + contrainte .header > div → un sous-titre trop long déborde horizontalement (mesurable) au lieu de wrapper hors bandeau
  • Fallback per-glyph : les rendus Latin sont inchangés (Bebas/Dosis servent toujours les glyphes Latin en premier)

CardPen js/frame.js (même philosophie que #400/#190) :

  • autoFitCardTitles cible désormais .title, .subtitle (seul Mémo Back a un .subtitle — rayon d'action nul ailleurs)
  • Nouveau autoFitFamilyGrid() : recherche dichotomique sur la font-size de .familyContainer (toute la grille est en em → un seul bouton rescale uniformément) quand .cardContainer déborde verticalement ; no-op si la carte tient ; branché dans generateImages() avant capture

Validation LIVE (Playwright, CardPen local sur l'arbre de travail, protocole géométrique)

Axe RU (avant → après) FR (non-régression)
Géométrie familles 6–7 coupées → 7 familles × 3 sous-familles × 3 items 7×3×3 intact, auto-fits NO-OP (tailles naturelles)
Sous-titre wrappé hors bandeau → 1 ligne dans le bandeau (taille naturelle suffit avec Oswald condensé) identique Golden Master
Polices serif fallback → Oswald 400/500 + PT Sans Narrow 400/700 chargées et utilisées Bebas/Dosis inchangées
Grille déborde → 5.93→5.43px, carte tient (overflow 2px = tolérance) font-size naturelle conservée

Captures : render_ru_fixed.png / render_fr_nonregression.png (validation locale, non commises).

Handoff régén

⚠ Après merge : clobber les harvests Mémo (Target/*/Harvest/*Memo*) avant régén Release, sinon le PNG montrera l'ancien render (leçon stale-harvest 2026-06-07).

🤖 Generated with Claude Code

… grid auto-fit

QA 2026-06-10 verdict: Memo Back RU FAIL x3 (subtitle wrapped out of the
banner, serif fallback on all display headings, families 6-7 cut off at
the card bottom). FR/EN/PT unaffected (PASS).

Template Cards/Memo/Argumentum_Memo_Back_fr.json:
- extCSS: add Oswald (cyrillic condensed display) + PT Sans Narrow
  (cyrillic condensed body) to the Google Fonts request
- fix 'sans-serit' typo on .header .subtitle (invalid token made the
  fallback resolve to the default serif)
- cyrillic-capable fallbacks on the latin-only display stacks:
  .subtitle/.family/.subfamily 'Bebas Neue'->+Oswald,
  .subsubfamily 'Dosis'->+PT Sans Narrow
- .subtitle: white-space:nowrap + max-width + overflow:hidden and
  .header > div max-width:100% so a too-long subtitle overflows
  horizontally (measurable) instead of wrapping out of the banner
- per-glyph fallback: Latin renders are byte-identical (Bebas/Dosis
  still serve all Latin glyphs first)

CardPen Generation/CardPen/js/frame.js:
- autoFitCardTitles now also targets .subtitle (only Memo Back uses it)
- new autoFitFamilyGrid(): binary-search the .familyContainer font-size
  when .cardContainer overflows vertically (grid is fully em-based so
  one knob rescales families/subfamilies/items uniformly); no-op when
  the card already fits; wired into generateImages() before capture

Validated live (Playwright, local CardPen on the working tree):
- RU: geometry 7 families x 3 subfamilies x 3 items, subtitle on one
  line inside the banner, no serif fallback, grid shrunk 5.93->5.43px,
  card fits (overflow 2px = tolerance)
- FR: both auto-fits NO-OP (natural sizes kept), 7x3x3 intact -> no
  regression vs Golden Master

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jsboige
jsboige merged commit 6f79894 into master Jun 10, 2026
3 checks passed
@jsboige
jsboige deleted the fix/memo-back-ru-overflow branch June 10, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant