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>
16 lines
757 B
XML
16 lines
757 B
XML
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
|
|
<rect x="1" y="1" width="254" height="382" rx="16" ry="16"
|
|
fill="#1a1a1a" stroke="#fb9fb1" stroke-width="2"/>
|
|
|
|
<!-- Top-left rank + small suit glyph. -->
|
|
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
|
|
fill="#fb9fb1">5</text>
|
|
<text x="14" y="68" font-family="Fira Mono" font-size="20"
|
|
fill="#fb9fb1">♥</text>
|
|
|
|
<!-- Bottom-right large suit glyph, rotated 180° about its own
|
|
baseline anchor so the glyph reads upside-down. -->
|
|
<text x="242" y="350" font-family="Fira Mono" font-size="64"
|
|
text-anchor="end" fill="#fb9fb1"
|
|
transform="rotate(180 242 332)">♥</text>
|
|
</svg> |