[logo] media cards with subtitles for vscode-clangd etc repositories

This commit is contained in:
Sam McCall 2020-04-22 13:30:04 +02:00
parent 45de907b37
commit d740d020b6
4 changed files with 34 additions and 7 deletions

1
logo/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
card-*.png

View File

@ -1,13 +1,21 @@
#!/bin/bash -ex
inkscape clangd.svg --export-png=card.png -h=640
SMALLER="-strip -define png:compression-filter=3"
PAD_TO="-background none -gravity center -extent"
LOGO_ONLY="--export-id=CD --export-background-opacity=0"
CONTRAST="-level 20%,100%,1.4"
inkscape clangd.svg $LOGO_ONLY --export-plain-svg=logo.svg
inkscape clangd.svg --export-png=card.png -h=640
mogrify $SMALLER card.png
inkscape clangd.svg --export-png=logo.png -h=1024 $LOGO_ONLY
mogrify $SMALLER $PAD_TO 1024x1024 logo.png
inkscape clangd.svg --export-png=favicon.png -h=16 $LOGO_ONLY --export-area-snap
mogrify -define png:exclude-chunk=all $CONTRAST $PAD_TO 16x16 favicon.png
# Set CARD="vscode coc www" to generate cards with subtitles.
for CARD in $CARDS; do
xmlstarlet < clangd.svg edit -P \
--update "//*[@id='subtitle']/*[local-name()='tspan']" --value "$CARD" \
| inkscape - --export-png=card-$CARD.png -h=640
mogrify $SMALLER card-$CARD.png
done

View File

@ -110,15 +110,15 @@
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:zoom="1.5270238"
inkscape:cx="316.64656"
inkscape:cy="230.01457"
inkscape:cx="402.76179"
inkscape:cy="151.43033"
inkscape:document-units="mm"
inkscape:current-layer="layer2"
showgrid="true"
showguides="true"
inkscape:window-width="1724"
inkscape:window-width="1916"
inkscape:window-height="1041"
inkscape:window-x="192"
inkscape:window-x="0"
inkscape:window-y="18"
inkscape:window-maximized="0"
fit-margin-top="10"
@ -135,7 +135,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@ -177,5 +177,14 @@
sodipodi:nodetypes="sssccccsccss"
inkscape:label="D" />
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1.25;font-family:'Noto Sans Mono';-inkscape-font-specification:'Noto Sans Mono, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;display:inline;opacity:1;fill:#5d5d5d;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="133.1293"
y="277.50995"
id="subtitle"
inkscape:label="subtitle"><tspan
sodipodi:role="line"
id="tspan4561"> </tspan></text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -125,5 +125,14 @@
style="fill:url(#linearGradient6316);fill-opacity:1;stroke:#0d386b;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="D" />
</g>
<text
id="subtitle"
y="277.50995"
x="133.1293"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.11111069px;line-height:1.25;font-family:'Noto Sans Mono';-inkscape-font-specification:'Noto Sans Mono, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;display:inline;opacity:1;fill:#5d5d5d;fill-opacity:1;stroke:none;stroke-width:0.26458332"
xml:space="preserve"><tspan
y="277.50995"
x="137.35988"
id="tspan4561"> </tspan></text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB