fix(engine): regenerate default theme SVGs to Terminal aesthetic
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>
This commit is contained in:
@@ -1,170 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<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="#d0d0d0" stroke-width="2"/>
|
||||
|
||||
<!-- http://code.google.com/p/vector-playing-cards/ -->
|
||||
<!-- Top-left rank + small suit glyph. -->
|
||||
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
|
||||
fill="#d0d0d0">5</text>
|
||||
<text x="14" y="68" font-family="Fira Mono" font-size="20"
|
||||
fill="#d0d0d0">♠</text>
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="167.0869141pt"
|
||||
height="242.6669922pt"
|
||||
viewBox="0 0 167.0869141 242.6669922"
|
||||
xml:space="preserve"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.0 r9654"
|
||||
sodipodi:docname="5_of_spades.svg"
|
||||
inkscape:export-filename="/home/byron/art/cards/final/PNGs/5_of_spades.png"
|
||||
inkscape:export-xdpi="215.44792"
|
||||
inkscape:export-ydpi="215.44792"><metadata
|
||||
id="metadata43"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs41" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1680"
|
||||
inkscape:window-height="977"
|
||||
id="namedview39"
|
||||
showgrid="false"
|
||||
inkscape:zoom="2.4336873"
|
||||
inkscape:cx="106.02254"
|
||||
inkscape:cy="157.08206"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="25"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2" />
|
||||
<g
|
||||
id="Layer_x0020_1"
|
||||
style="fill-rule:nonzero;clip-rule:nonzero;stroke:#000000;stroke-miterlimit:4;">
|
||||
<path
|
||||
style="fill:#FFFFFF;stroke-width:0.5;"
|
||||
d="M166.8369141,235.5478516c0,3.7773438-3.0869141,6.8691406-6.8710938,6.8691406H7.1108398c-3.7749023,0-6.8608398-3.0917969-6.8608398-6.8691406V7.1201172C0.25,3.3427734,3.3359375,0.25,7.1108398,0.25h152.8549805 c3.7841797,0,6.8710938,3.0927734,6.8710938,6.8701172v228.4277344z"
|
||||
id="path5" />
|
||||
<g
|
||||
style="stroke:none;"
|
||||
id="g7">
|
||||
<g
|
||||
id="g9">
|
||||
|
||||
</g>
|
||||
|
||||
</g>
|
||||
<g
|
||||
id="g15">
|
||||
|
||||
</g>
|
||||
<g
|
||||
id="g19">
|
||||
|
||||
</g>
|
||||
<g
|
||||
style="stroke:none;"
|
||||
id="g23">
|
||||
<g
|
||||
id="g25">
|
||||
|
||||
</g>
|
||||
|
||||
</g>
|
||||
<g
|
||||
style="stroke:none;"
|
||||
id="g31">
|
||||
<g
|
||||
id="g33">
|
||||
|
||||
</g>
|
||||
|
||||
</g>
|
||||
</g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:32px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
|
||||
x="8.5467014"
|
||||
y="28.013288"
|
||||
id="text3788"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3790"
|
||||
x="8.5467014"
|
||||
y="28.013288"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial">5</tspan></text>
|
||||
|
||||
|
||||
|
||||
<g
|
||||
transform="matrix(1.5085945,0,0,1.3793253,16.929104,45.065897)"
|
||||
id="layer1-7"><path
|
||||
id="sl"
|
||||
d="M 7.989,3.103 C 7.747,-0.954 0.242,-8.59 0,-10.5 c -0.242,1.909 -7.747,9.545 -7.989,13.603 -0.169,2.868 1.695,4.057 3.39,4.057 1.8351685,-0.021581 3.3508701,-2.8006944 3.873,-3.341 0.242,0.716 -1.603,6.682 -2.179,6.682 l 5.811,0 C 2.33,10.501 0.485,4.535 0.727,3.819 1.1841472,4.3152961 2.5241276,7.0768295 4.601,7.16 6.295,7.159 8.158,5.971 7.989,3.103 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000"
|
||||
sodipodi:nodetypes="cccccccccc" /></g>
|
||||
<g
|
||||
transform="matrix(2.6486789,0,0,2.4217176,56.21089,49.365995)"
|
||||
id="layer1-7-88"><path
|
||||
id="sl-4"
|
||||
d="M 7.989,3.103 C 7.747,-0.954 0.242,-8.59 0,-10.5 c -0.242,1.909 -7.747,9.545 -7.989,13.603 -0.169,2.868 1.695,4.057 3.39,4.057 1.8351685,-0.021581 3.3508701,-2.8006944 3.873,-3.341 0.242,0.716 -1.603,6.682 -2.179,6.682 l 5.811,0 C 2.33,10.501 0.485,4.535 0.727,3.819 1.1841472,4.3152961 2.5241276,7.0768295 4.601,7.16 6.295,7.159 8.158,5.971 7.989,3.103 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000"
|
||||
sodipodi:nodetypes="cccccccccc" /></g><text
|
||||
xml:space="preserve"
|
||||
style="font-size:32px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
|
||||
x="-158.97775"
|
||||
y="-215.12402"
|
||||
id="text3788-7"
|
||||
sodipodi:linespacing="125%"
|
||||
transform="scale(-1,-1)"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3790-6"
|
||||
x="-158.97775"
|
||||
y="-215.12402"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Arial;-inkscape-font-specification:Arial">5</tspan></text>
|
||||
|
||||
|
||||
<g
|
||||
transform="matrix(-1.5085945,0,0,-1.3793253,150.22511,198.04408)"
|
||||
id="layer1-7-3"><path
|
||||
id="sl-1"
|
||||
d="M 7.989,3.103 C 7.747,-0.954 0.242,-8.59 0,-10.5 c -0.242,1.909 -7.747,9.545 -7.989,13.603 -0.169,2.868 1.695,4.057 3.39,4.057 1.8351685,-0.021581 3.3508701,-2.8006944 3.873,-3.341 0.242,0.716 -1.603,6.682 -2.179,6.682 l 5.811,0 C 2.33,10.501 0.485,4.535 0.727,3.819 1.1841472,4.3152961 2.5241276,7.0768295 4.601,7.16 6.295,7.159 8.158,5.971 7.989,3.103 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000"
|
||||
sodipodi:nodetypes="cccccccccc" /></g><g
|
||||
transform="matrix(-2.6486789,0,0,-2.4217176,56.25613,193.77132)"
|
||||
id="layer1-7-88-7"><path
|
||||
id="sl-4-5"
|
||||
d="M 7.989,3.103 C 7.747,-0.954 0.242,-8.59 0,-10.5 c -0.242,1.909 -7.747,9.545 -7.989,13.603 -0.169,2.868 1.695,4.057 3.39,4.057 1.8351685,-0.021581 3.3508701,-2.8006944 3.873,-3.341 0.242,0.716 -1.603,6.682 -2.179,6.682 l 5.811,0 C 2.33,10.501 0.485,4.535 0.727,3.819 1.1841472,4.3152961 2.5241276,7.0768295 4.601,7.16 6.295,7.159 8.158,5.971 7.989,3.103 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000"
|
||||
sodipodi:nodetypes="cccccccccc" /></g><g
|
||||
transform="matrix(2.6486789,0,0,2.4217176,83.494697,119.06732)"
|
||||
id="layer1-7-88-6"><path
|
||||
id="sl-4-8"
|
||||
d="M 7.989,3.103 C 7.747,-0.954 0.242,-8.59 0,-10.5 c -0.242,1.909 -7.747,9.545 -7.989,13.603 -0.169,2.868 1.695,4.057 3.39,4.057 1.8351685,-0.021581 3.3508701,-2.8006944 3.873,-3.341 0.242,0.716 -1.603,6.682 -2.179,6.682 l 5.811,0 C 2.33,10.501 0.485,4.535 0.727,3.819 1.1841472,4.3152961 2.5241276,7.0768295 4.601,7.16 6.295,7.159 8.158,5.971 7.989,3.103 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000"
|
||||
sodipodi:nodetypes="cccccccccc" /></g><g
|
||||
transform="matrix(2.6486789,0,0,2.4217176,109.93095,49.495625)"
|
||||
id="layer1-7-88-8"><path
|
||||
id="sl-4-9"
|
||||
d="M 7.989,3.103 C 7.747,-0.954 0.242,-8.59 0,-10.5 c -0.242,1.909 -7.747,9.545 -7.989,13.603 -0.169,2.868 1.695,4.057 3.39,4.057 1.8351685,-0.021581 3.3508701,-2.8006944 3.873,-3.341 0.242,0.716 -1.603,6.682 -2.179,6.682 l 5.811,0 C 2.33,10.501 0.485,4.535 0.727,3.819 1.1841472,4.3152961 2.5241276,7.0768295 4.601,7.16 6.295,7.159 8.158,5.971 7.989,3.103 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000"
|
||||
sodipodi:nodetypes="cccccccccc" /></g><g
|
||||
transform="matrix(-2.6486789,0,0,-2.4217176,109.97619,193.90095)"
|
||||
id="layer1-7-88-7-2"><path
|
||||
id="sl-4-5-6"
|
||||
d="M 7.989,3.103 C 7.747,-0.954 0.242,-8.59 0,-10.5 c -0.242,1.909 -7.747,9.545 -7.989,13.603 -0.169,2.868 1.695,4.057 3.39,4.057 1.8351685,-0.021581 3.3508701,-2.8006944 3.873,-3.341 0.242,0.716 -1.603,6.682 -2.179,6.682 l 5.811,0 C 2.33,10.501 0.485,4.535 0.727,3.819 1.1841472,4.3152961 2.5241276,7.0768295 4.601,7.16 6.295,7.159 8.158,5.971 7.989,3.103 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000"
|
||||
sodipodi:nodetypes="cccccccccc" /></g></svg>
|
||||
<!-- 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="#d0d0d0"
|
||||
transform="rotate(180 242 332)">♠</text>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 757 B |
Reference in New Issue
Block a user