Open nschloe opened 2 years ago
I just found that nano does just that.
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:v="https://vecta.io/nano" xmlns:xlink="http://www.w3.org/1999/xlink" width="130.639" height="33.279" viewBox="0 0 34.565 8.805">
<path d="M.759 2.636c.374 0 .685-.21.88-.591h.089c-.031.273-.007.564.646.564h.263l.096-.552h-.116c-.265 0-.333-.068-.294-.294L2.631.004h-.06C1.107.004.002.757.002 1.917c0 .456.275.719.757.719zm.157-.62c-.169 0-.246-.072-.246-.232 0-.56.502-1.003 1.184-1.129l-.055.321c-.116.663-.461 1.039-.883 1.039z" />
<path d="M3.653 2.636c.374 0 .685-.21.88-.591h.089c-.031.273-.007.564.646.564h.263l.096-.552h-.116c-.265 0-.333-.068-.294-.294L5.525.004h-.06c-1.464 0-2.568.752-2.568 1.912 0 .456.275.719.757.719zm.157-.62c-.169 0-.246-.072-.246-.232 0-.56.502-1.003 1.184-1.129l-.055.321c-.116.663-.461 1.039-.883 1.039z" />
<path d="M6.547 2.636c.374 0 .685-.21.88-.591h.089c-.031.273-.007.564.646.564h.263l.096-.552h-.116c-.265 0-.333-.068-.294-.294L8.419.004h-.06C6.895.004 5.79.757 5.79 1.917c0 .456.275.719.757.719zm.157-.62c-.169 0-.246-.072-.246-.232 0-.56.502-1.003 1.184-1.129l-.055.321c-.116.663-.461 1.039-.883 1.039z" />
<use xlink:href="#B" />
<use xlink:href="#B" x="2.895" />
<use xlink:href="#B" x="5.789" />
<use xlink:href="#B" x="8.683" />
<use xlink:href="#B" x="11.577" />
<use xlink:href="#B" x="14.471" />
<use xlink:href="#B" x="17.365" />
<use xlink:href="#B" x="20.259" />
<use xlink:href="#B" x="23.153" />
<use xlink:href="#B" x="-8.682" y="6.174" />
<use xlink:href="#B" x="-5.788" y="6.174" />
<use xlink:href="#B" x="-2.894" y="6.174" />
<use xlink:href="#B" y="6.174" />
<use xlink:href="#B" x="2.895" y="6.174" />
<use xlink:href="#B" x="5.789" y="6.174" />
<use xlink:href="#B" x="8.683" y="6.174" />
<use xlink:href="#B" x="11.577" y="6.174" />
<use xlink:href="#B" x="14.471" y="6.174" />
<use xlink:href="#B" x="17.365" y="6.174" />
<use xlink:href="#B" x="20.259" y="6.174" />
<use xlink:href="#B" x="23.153" y="6.174" />
<defs>
<path id="B" d="M9.441 2.636c.374 0 .685-.21.88-.591h.089c-.031.273-.007.564.646.564h.263l.096-.552h-.116c-.265 0-.333-.068-.294-.294l.306-1.758h-.06c-1.464 0-2.568.752-2.568 1.912 0 .456.275.719.757.719zm.157-.62c-.169 0-.246-.072-.246-.232 0-.56.502-1.003 1.184-1.129l-.055.321c-.116.663-.461 1.039-.883 1.039z" />
</defs>
</svg>
I often have to deal with SVG images that contain mostly text, i.e., letters as paths. Letters repeat, and so do the paths, only with a different offset.
Is it possible to store the individual letters, for example in
<defs>
, and just<use>
them in the text with a given offset transform? This could be done for every path that coincides with another modulo translation/rotation/scaling.An extreme example: