Skip to content

SVG error does not support non integer width,height #520

Description

@offbeat-stuff

Sample code:
https://play.nim-lang.org/#ix=4jzw
Here is a sample svg:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="347.0625" height="347.078125" viewBox="0 0 347.0625 347.078125">
<defs>
<filter id="filter-remove-color-and-invert-alpha" x="0%" y="0%" width="100%" height="100%">
<feColorMatrix color-interpolation-filters="sRGB" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -1 1"/>
</filter>
<filter id="filter-0" x="0%" y="0%" width="100%" height="100%">
<feImage xlink:href="#compositing-group-1" result="source" x="0" y="0" width="416.475" height="416.49375"/>
<feImage xlink:href="#compositing-group-2" result="destination" x="0" y="0" width="416.475" height="416.49375"/>
<feComposite in="source" in2="destination" operator="arithmetic" k1="0" k2="1" k3="1" k4="0" color-interpolation-filters="sRGB"/>
</filter>
<g>
<g id="glyph-0-0">
<path d="M 144.671875 -31.375 L 144.671875 0 L 26.386719 0 L 26.386719 -31.375 L 70.234375 -31.375 L 70.234375 -141.128906 L 32.820312 -117.761719 L 15.230469 -146.25 L 73.910156 -181.957031 L 110.671875 -181.957031 L 110.671875 -31.375 Z M 144.671875 -31.375 "/>
</g>
<g id="glyph-0-1">
<path d="M 78.769531 -186.550781 C 100.472656 -186.550781 116.863281 -178.171875 127.933594 -161.410156 C 139.003906 -144.652344 144.542969 -121.304688 144.542969 -91.371094 C 144.542969 -61.351562 139.003906 -37.875 127.933594 -20.941406 C 116.863281 -4.003906 100.472656 4.464844 78.769531 4.464844 C 56.890625 4.464844 40.457031 -4.003906 29.472656 -20.941406 C 18.488281 -37.875 12.996094 -61.351562 12.996094 -91.371094 C 12.996094 -121.304688 18.488281 -144.652344 29.472656 -161.410156 C 40.457031 -178.171875 56.890625 -186.550781 78.769531 -186.550781 Z M 78.769531 -156.488281 C 69.492188 -156.488281 62.710938 -151.519531 58.421875 -141.585938 C 54.132812 -131.652344 51.988281 -114.914062 51.988281 -91.371094 C 51.988281 -83.671875 52.117188 -76.820312 52.382812 -70.828125 C 52.644531 -64.832031 53.039062 -59.515625 53.5625 -54.875 L 97.9375 -147.691406 C 95.835938 -151.019531 93.230469 -153.316406 90.125 -154.585938 C 87.019531 -155.855469 83.234375 -156.488281 78.769531 -156.488281 Z M 105.289062 -91.371094 C 105.289062 -101.4375 105.070312 -109.925781 104.632812 -116.839844 L 62.753906 -30.324219 C 64.679688 -28.488281 66.976562 -27.21875 69.644531 -26.519531 C 72.316406 -25.820312 75.355469 -25.46875 78.769531 -25.46875 C 84.984375 -25.46875 90.039062 -27.570312 93.933594 -31.769531 C 97.828125 -35.972656 100.691406 -42.90625 102.53125 -52.578125 C 104.371094 -62.25 105.289062 -75.179688 105.289062 -91.371094 Z M 105.289062 -91.371094 "/>
</g>
</g>
<g id="compositing-group-0" transform="translate(34.70625, 34.707813)">
<rect x="-34.70625" y="-34.707813" width="416.475" height="416.49375" fill="rgb(0%, 0%, 0%)" fill-opacity="0"/>
<rect x="-34.70625" y="-34.707813" width="416.475" height="416.49375" fill="rgb(100%, 100%, 100%)" fill-opacity="1"/>
</g>
<mask id="mask-0">
<use xlink:href="#compositing-group-0"/>
</mask>
<mask id="mask-1">
<use xlink:href="#compositing-group-0" filter="url(#filter-remove-color-and-invert-alpha)"/>
</mask>
<g id="compositing-group-1" mask="url(#mask-0)">
<g transform="translate(34.70625, 34.707813)">
<rect x="-34.70625" y="-34.707813" width="416.475" height="416.49375" fill="rgb(100%, 100%, 100%)" fill-opacity="1"/>
</g>
</g>
<g id="compositing-group-2" mask="url(#mask-1)">
<g transform="translate(34.70625, 34.707813)">
</g>
</g>
</defs>
<g filter="url(#filter-0)" transform="translate(-34.70625, -34.707813)">
<rect x="0" y="0" width="416.475" height="416.49375" fill="rgb(0%, 0%, 0%)" fill-opacity="1"/>
</g>
<g fill="rgb(0%, 0%, 0%)" fill-opacity="1">
<use xlink:href="#glyph-0-0" x="16" y="252.3125"/>
<use xlink:href="#glyph-0-1" x="173.53125" y="252.3125"/>
</g>
</svg>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions