Files
VoxVera/docs/flyer-field-limits.md
T
thePR0M3TH3ANandClaude Opus 4.8 127f9c3134 Locale-aware defaults: browser language list + US Letter/A4 paper size
Language inference:
- Walk navigator.languages (the full ordered preference list), not just
  navigator.language, and pick the first base language we support. A user who
  prefers e.g. Dutch then German now gets German instead of the English
  fallback. De-duplicates the default-language resolution into setDefaultText.

Paper size (US Letter + A4):
- Add A4 (210x297mm) alongside US Letter (8.5x11in). Sheet dimensions move to
  CSS custom properties (--sheet-w/--sheet-h) toggled by a paper-letter/paper-a4
  class on <html>; the tear-off column and QR codes stay fixed physical sizes
  and the content column flexes.
- @page size is injected by JS (id voxvera-page-size) since @page cannot read
  CSS variables across engines; the print block keeps margin:0 and a Letter
  default for the pre-JS state.
- Default paper is chosen from the browser locale's region subtag
  (en-US -> Letter, en-GB/de-DE -> A4) — "by location" without geolocation,
  falling back to Letter when no region is present. A manual override selector
  (topbar + viewer controls) persists in localStorage and wins over the default.
- Paper size is a local print/view preference and is never written into the
  Nostr event, so a flyer reprints on either size unchanged.
- Add paper_size/paper_letter/paper_a4 labels for all 14 languages.

Docs + tests:
- Spec gains a "Print paper size" section; AGENTS.md records the
  not-in-payload invariant; README adds a feature bullet; the field-limits
  cheat sheet gains Letter/A4 columns (re-measured per paper size).
- Playwright: add tests for navigator.languages inference, region-based paper
  default (A4 and Letter), and override persistence. 54 tests pass across
  Chromium, Firefox, WebKit, and Android/iOS mobile emulations.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-09 15:56:25 -04:00

75 lines
3.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Flyer Field Length Cheat Sheet
How much text fits in each flyer field, by script.
VoxVera does **not** impose a fixed character count. The editor measures the
rendered flyer live and rejects a keystroke the moment a field would overflow
the printable sheet (you'll see an inline "too long" error under that field).
So the real limit is enforced for you as you type — the numbers below are
practical guidance for drafting copy, sizing translations, or prompting an LLM
to write flyer text that will fit on the first try.
Capacity varies by **script** (not by individual language) and by **paper
size**, for these reasons:
1. The flyer body font is monospace (`Courier New`), so within a script every
character takes the same width regardless of upper/lowercase.
2. Per-script letter-spacing policy (`ls-full` / `ls-cjk` / `ls-none`, see
[`nostr-static-client-spec.md`](nostr-static-client-spec.md#letter-spacing-by-script)).
3. Glyph width differs by script — CJK glyphs are full-width (≈2× a Latin
character), Devanagari fallback glyphs are narrower, etc.
4. **Paper size.** A4 (210×297mm) is slightly narrower and taller than US
Letter (8.5×11in), so single-line fields hold ~2 fewer characters on A4
while the body holds a little more. Both sizes are shown below.
## Single-line fields (hard caps)
**Title**, **Subtitle**, and **Headline** are single-line: they never wrap, so
these are the limits people actually run into. Counts are characters
(codepoints), shown as **Letter / A4**.
| Languages | Title & Headline | Subtitle |
|---|---|---|
| Latin & Cyrillic & Hebrew — en, es, de, fr, pt, sw, tr, ru, he | ~28 / ~26 | ~32 / ~30 |
| Arabic & Persian — ar, fa | ~28 / ~27 | ~38 / ~36 |
| Devanagari — hi | ~36 / ~35 | ~51 / ~48 |
| CJK — ja, zh | ~17 / ~16 | ~23 / ~21 |
## Multi-line fields (generous)
**Body** (content), **Link message** (`url_message`), and **Footer**
(`footer_message`) wrap across multiple lines, so they hold far more and are
bounded only by the remaining height of the sheet.
| Languages | Body (content) — Letter / A4 |
|---|---|
| Latin & Cyrillic & Hebrew | ~1,900 / ~2,000 (a few hundred words) |
| Arabic & Persian | ~1,850 / ~1,930 |
| Devanagari — hi | ~2,450 / ~2,545 |
| CJK — ja, zh | ~1,170 / ~1,220 |
`url_message` and `footer_message` share the lower portion of the sheet and can
hold roughly 1,200–4,800 characters depending on script, but for a readable
flyer keep the link message to a sentence and the footer to a short line.
The **URL** field is a link, not body copy — keep it short both because it's
shown verbatim on the flyer and because it becomes the main QR code (shorter
URLs scan more reliably).
## Notes and caveats
- **Approximate.** These come from rendering each script in a headless browser
at true print size for both Letter (8.5×11in) and A4 (210×297mm). The
Latin/Cyrillic numbers (`Courier New`) are the most reliable; numbers for
Hebrew, Arabic, Persian, Devanagari, and CJK depend on the system fallback
font, which can differ slightly between devices and from print output.
- **The app is authoritative.** If the editor accepts your text it fits; if it
rejects it, shorten it. Treat this sheet as a target, not a contract.
- **Redaction markup counts.** Wrapping text in `~~double tildes~~` renders it
struck-through; the four `~` characters count toward the field length even
though they don't appear on the flyer.
- **Re-measuring.** If the flyer layout, font, or letter-spacing policy
changes, these numbers should be re-derived by rendering each script at print
size and binary-searching each field for the largest run of characters that
does not overflow the field target or the sheet.