Skip to content

v0.5.4

Choose a tag to compare

@cmj0121 cmj0121 released this 05 May 08:42
· 60 commits to main since this release

Highlights

  • Banner pastes as one line per row again — copying the /stock banner from Arc or Chrome was producing 9-11 stacked lines per visual row instead of the readable banner. Chromium's clipboard serializer inserts a newline between sibling <text> SVG elements, and pylon's emitter splits each row across <rect> block-glyph runs, leaving 9-11 sibling <text> per banner row. A new render.CoalesceSVGText post-processor merges same-row <text> siblings into one <text> carrying <tspan> children — <tspan> siblings serialize as a single text run. Idempotent and a no-op for non-fragmented rows. Wired into the SVG and HTML render paths; PNG path is intentionally skipped because pylon's SVG rasterizer reads <text> bodies via xml.Decoder which drops chardata once a child element appears.
  • Bare ?lang=zh resolves to zh-TW — explicit user override now lands on the deployment's native script (TW market focus) as the least-surprising outcome. Previous behavior followed CLDR's bare-zh → simplified default, which surprised TW visitors typing ?lang=zh. Callers wanting simplified must say ?lang=zh-CN or ?lang=zh-Hans explicitly. The Accept-Language matcher path is unchanged — Accept-Language: zh still routes to zh-CN via the CLDR matcher; the divergence is contained to the explicit override path.

Other changes

  • render/svg_coalesce.go and render/svg_coalesce_test.go add the post-processor and 7 unit tests + 1 end-to-end via render.Banner covering: solo-row byte-identity, multi-segment coalescing, rect preservation, idempotence, empty input, multi-row groups, and a live /tmp/stock.svg snapshot smoke test.
  • internal/i18n/i18n.go::parseLocaleQuery flips bare zh from LocaleZhCN to LocaleZhTW. The doc comment explains why (deployment audience > CLDR default for the explicit-override path).
  • docs/localization.md updated: the BCP-47 acceptance table now lists zh under Traditional, the prose paragraph documents the divergence between ?lang= and Accept-Language paths.

Container image

ghcr.io/cmj0121/imagelet:0.5.4