reccmp: improve progress bar text rendering

This commit is contained in:
itsmattkc 2023-06-27 18:00:53 -07:00
parent 40fdc5b2f5
commit f03cee6b6e
2 changed files with 26 additions and 16 deletions

View file

@ -429,7 +429,7 @@ def gen_svg(svg, name, icon, implemented_funcs, total_funcs, raw_accuracy):
templatedata = templatedata[0:percentstart] + str(progwidth) + templatedata[percentend + 1:] templatedata = templatedata[0:percentstart] + str(progwidth) + templatedata[percentend + 1:]
# Replace percentage statistic # Replace percentage statistic
templatedata = templatedata.replace('{percent}', '%.2f%%' % (total_statistic * 100), 1) templatedata = templatedata.replace('{percent}', '%.2f%%' % (total_statistic * 100), 2)
svgfile = open(svg, 'w') svgfile = open(svg, 'w')
if not svgfile: if not svgfile:

View file

@ -10,13 +10,12 @@
xml:space="preserve" xml:space="preserve"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs xmlns:svg="http://www.w3.org/2000/svg"><defs>
id="defs2"><rect <clipPath id="progBarCutoff">
x="79.651809" <rect width="{progbar:127.18422}" height="8.6508904" x="21.074554" y="134.86963" />
y="538.62568" </clipPath>
width="480.69626" </defs><rect
height="32.696293" x="0" y="0" width="100%" height="100%" fill="#0d1117" /><g
id="rect1277" /></defs><rect x="0" y="0" width="100%" height="100%" fill="#0d1117" /><g
id="g1273" id="g1273"
transform="translate(-3.9577451e-7,-0.93505135)"><image transform="translate(-3.9577451e-7,-0.93505135)"><image
width="84.666664" width="84.666664"
@ -43,19 +42,30 @@
width="127.18422" width="127.18422"
height="8.6508904" height="8.6508904"
x="21.074554" x="21.074554"
y="134.86963" /><rect
style="display:inline;fill:#ffffff;stroke:none;stroke-width:2.6764"
id="rect1169"
width="{progbar:127.18422}"
height="8.6508904"
x="21.074554"
y="134.86963" /><text y="134.86963" /><text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333px;font-family:mono;-inkscape-font-specification:mono;text-align:start;text-anchor:start;fill:#c0c0c0;fill-opacity:1;stroke:none;stroke-width:1.05833;stroke-dasharray:none;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333px;font-family:mono;-inkscape-font-specification:mono;text-align:start;text-anchor:start;fill:white;fill-opacity:1;stroke:none;stroke-width:1.05833;stroke-dasharray:none;stroke-opacity:1"
x="76.841347" x="76.841347"
y="140.70638" y="140.70638"
id="text2152"><tspan id="text2152"><tspan
style="font-size:4.23333px;fill:#c0c0c0;fill-opacity:1;stroke-width:1.05833" style="font-size:4.23333px;fill:white;fill-opacity:1;stroke-width:1.05833"
x="76.841347"
y="140.70638"
id="tspan2150">{percent}</tspan></text><rect
style="display:inline;fill:#ffffff;stroke:none;stroke-width:2.6764"
id="rect1169"
width="127.18422"
height="8.6508904"
x="21.074554"
y="134.86963"
clip-path="url(#progBarCutoff)" /><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333px;font-family:mono;-inkscape-font-specification:mono;text-align:start;text-anchor:start;fill:black;fill-opacity:1;stroke:none;stroke-width:1.05833;stroke-dasharray:none;stroke-opacity:1"
x="76.841347"
y="140.70638"
id="text2152"
clip-path="url(#progBarCutoff)"><tspan
style="font-size:4.23333px;fill:black;fill-opacity:1;stroke-width:1.05833"
x="76.841347" x="76.841347"
y="140.70638" y="140.70638"
id="tspan2150">{percent}</tspan></text></g><text id="tspan2150">{percent}</tspan></text></g><text

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 4 KiB