a14200ac2f
Step 4's PNG regeneration left the cards looking unchanged at
runtime because the PNGs at assets/cards/ are only the *fallback*
art — production renders the bundled-default theme's SVGs, which
get include_bytes!()-embedded into the binary by
solitaire_engine::assets::sources and applied to CardImageSet at
startup by theme::plugin::apply_theme_to_card_image_set. Those
SVGs were still the legacy vector-playing-cards art.
Extends card_face_generator to write SVGs into both runtime
paths in lockstep:
1. assets/cards/{faces,backs}/*.png — fallback art (unchanged
from step 4).
2. solitaire_engine/assets/themes/default/*.svg — what production
actually renders. 52 face SVGs + 1 back SVG, generated from
the same face_svg / back_svg builders as the PNGs so the two
paths can never visually diverge.
Adds two helper functions to card_face_svg:
- theme_suit_token (clubs/diamonds/hearts/spades — lowercase
full word, matching CardKey::manifest_name)
- theme_rank_token (ace/2..10/jack/queen/king — same)
The theme back uses BACK_ACCENTS[0] (canonical Terminal cyan).
The other four accents only live as PNG fallbacks because the
theme system carries one back per theme.
Net SVG diff: -14884 / +940 lines — the legacy vector-playing-
cards SVGs were ~300 lines each of Inkscape-authored paths;
the Terminal SVGs are ~10 lines of programmatic output.
Workspace clippy + cargo test --workspace clean. Pin test
unaffected (the SVG builders themselves did not change).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
21 lines
956 B
XML
21 lines
956 B
XML
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
|
|
<defs>
|
|
<pattern id="scanlines" x="0" y="0" width="2" height="4" patternUnits="userSpaceOnUse">
|
|
<rect x="0" y="0" width="2" height="2" fill="#1a1a1a"/>
|
|
</pattern>
|
|
</defs>
|
|
|
|
<!-- Background fill, then scanlines on top (the scanlines stay
|
|
darker than BACK_BG so the "off" rows show through). -->
|
|
<rect x="1" y="1" width="254" height="382" rx="16" ry="16"
|
|
fill="#151515" stroke="#353535" stroke-width="2"/>
|
|
<rect x="1" y="1" width="254" height="382" rx="16" ry="16"
|
|
fill="url(#scanlines)"/>
|
|
|
|
<!-- Top-left accent badge (the only theme-varying element). -->
|
|
<rect x="12" y="12" width="24" height="32" fill="#6fc2ef"/>
|
|
|
|
<!-- Bottom-right "▌RS" monogram in JetBrains-Mono-styled FiraMono. -->
|
|
<text x="244" y="368" font-family="Fira Mono" font-size="24"
|
|
fill="#505050" text-anchor="end">▌RS</text>
|
|
</svg> |