scour-project / scour

Scour - An SVG Optimizer / Cleaner
Apache License 2.0
770 stars 60 forks source link

text-anchor="start" removed in defs #281

Open JoKalliauer opened 3 years ago

JoKalliauer commented 3 years ago

original svg-file

The original file is described at https://en.wikipedia.org/wiki/File:Comparison_gender_life_expectancy_CIA_factbook.svg

svg

minimal input

<?xml version="1.0" encoding="UTF-8"?>
<svg width="280" height="245" font-family="Helvetica, Arial, sans-serif" font-size="16" viewBox="350 -953 560 490" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 <defs>
  <text id="a" x="728" y="-680" dy=".7ex" fill="#930" text-anchor="start">India</text>
 </defs>
 <use width="100%" height="100%" text-anchor="middle" xlink:href="#a"/>
</svg>

output

<?xml version="1.0" encoding="UTF-8"?>
<svg width="280" height="245" font-family="Helvetica, Arial, sans-serif" font-size="16" viewBox="350 -953 560 490" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 <defs>
  <text id="a" x="728" y="-680" dy=".7ex" fill="#930">India</text>
 </defs>
 <use width="100%" height="100%" text-anchor="middle" xlink:href="#a"/>
</svg>

comparision

input output(offset)
https://gitlab.com/inkscape/inbox/uploads/acf333b40dd87a1b6310073cb9bfb6e5/Input.svg https://gitlab.com/inkscape/inbox/uploads/ac6af7eceee6ea2d05f20e453e9248fe/output.svg

copyright

source https://en.wikipedia.org/wiki/File:Comparison_gender_life_expectancy_CIA_factbook.svg

author https://commons.wikimedia.org/wiki/User:Cmglee

license https://creativecommons.org/licenses/by-sa/3.0