paperjs / paper.js

The Swiss Army Knife of Vector Graphics Scripting – Scriptographer ported to JavaScript and the browser, using HTML5 Canvas. Created by @lehni & @puckey
http://paperjs.org
Other
14.37k stars 1.22k forks source link

Importing Symbols #1329

Open adamdyson opened 7 years ago

adamdyson commented 7 years ago

I'm trying to process some SVG that was produced by pango. However nothing is visible.

This is the SVG content being passed to Paper.

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="974pt" height="540pt" viewBox="0 0 974 540" version="1.1">
<defs>
<g>
<symbol overflow="visible" id="glyph0-0">
<path style="stroke:none;" d="M 12.5 0 L 12.5 -159.96875 L 87.5 -159.96875 L 87.5 0 Z M 25 -12.5 L 75 -12.5 L 75 -147.46875 L 25 -147.46875 Z M 25 -12.5 "/>
</symbol>
<symbol overflow="visible" id="glyph0-1">
<path style="stroke:none;" d="M 107.8125 -109.578125 C 103.644531 -109.578125 100.519531 -112.015625 98.4375 -116.890625 C 96.613281 -121.054688 94.921875 -123.597656 93.359375 -124.515625 C 91.992188 -125.234375 88.609375 -125.59375 83.203125 -125.59375 C 73.765625 -125.59375 63.285156 -118.363281 51.765625 -103.90625 C 36.140625 -84.507812 28.328125 -66.117188 28.328125 -48.734375 C 28.328125 -40.335938 31.023438 -33.109375 36.421875 -27.046875 C 41.960938 -20.796875 48.640625 -17.671875 56.453125 -17.671875 C 63.148438 -17.671875 69.882812 -19.398438 76.65625 -22.859375 C 80.4375 -24.804688 86.234375 -28.644531 94.046875 -34.375 C 97.753906 -37.113281 100.550781 -38.484375 102.4375 -38.484375 C 105.238281 -38.484375 107.582031 -37.421875 109.46875 -35.296875 C 111.363281 -33.179688 112.3125 -30.820312 112.3125 -28.21875 C 112.3125 -25.289062 111.070312 -22.722656 108.59375 -20.515625 C 91.40625 -5.273438 74.023438 2.34375 56.453125 2.34375 C 42.972656 2.34375 31.578125 -2.832031 22.265625 -13.1875 C 13.285156 -23.207031 8.796875 -35.054688 8.796875 -48.734375 C 8.796875 -70.804688 18.039062 -93.429688 36.53125 -116.609375 C 51.957031 -135.941406 67.515625 -145.609375 83.203125 -145.609375 C 86.390625 -145.609375 89.253906 -145.460938 91.796875 -145.171875 C 94.335938 -144.878906 96.582031 -144.40625 98.53125 -143.75 C 100.8125 -147.070312 103.773438 -148.734375 107.421875 -148.734375 C 111.910156 -148.734375 114.742188 -145.769531 115.921875 -139.84375 C 116.960938 -134.570312 117.484375 -128.09375 117.484375 -120.40625 C 117.484375 -117.738281 116.765625 -115.394531 115.328125 -113.375 C 113.578125 -110.84375 111.070312 -109.578125 107.8125 -109.578125 Z M 107.8125 -109.578125 "/>
</symbol>
<symbol overflow="visible" id="glyph0-2">
<path style="stroke:none;" d="M 95.3125 6.0625 C 90.6875 6.0625 87.660156 3.582031 86.234375 -1.375 C 84.734375 -6.707031 83.363281 -14.289062 82.125 -24.125 C 80.957031 -33.5625 80.375 -41.304688 80.375 -47.359375 C 80.375 -49.054688 80.453125 -51.628906 80.609375 -55.078125 C 80.773438 -58.523438 80.859375 -61.097656 80.859375 -62.796875 C 80.859375 -75.035156 77.800781 -81.15625 71.6875 -81.15625 C 63.414062 -81.15625 56.023438 -77.410156 49.515625 -69.921875 C 46.191406 -66.078125 41.632812 -58.753906 35.84375 -47.953125 C 35.84375 -23.148438 34.800781 -8.46875 32.71875 -3.90625 C 30.894531 0.132812 28.0625 2.15625 24.21875 2.15625 C 21.550781 2.15625 19.207031 1.242188 17.1875 -0.578125 C 15.164062 -2.410156 14.15625 -4.628906 14.15625 -7.234375 C 14.15625 -8.140625 14.453125 -9.570312 15.046875 -11.53125 C 15.566406 -13.15625 15.921875 -17.90625 16.109375 -25.78125 L 16.40625 -40.234375 L 16.703125 -112.015625 C 17.160156 -120.085938 17.390625 -125.523438 17.390625 -128.328125 C 17.390625 -131.640625 17.078125 -134.773438 16.453125 -137.734375 C 15.835938 -140.703125 15.53125 -143.78125 15.53125 -146.96875 C 15.53125 -149.707031 16.472656 -151.972656 18.359375 -153.765625 C 20.242188 -155.554688 22.554688 -156.453125 25.296875 -156.453125 C 30.628906 -156.453125 33.753906 -153.585938 34.671875 -147.859375 C 35.710938 -141.535156 36.234375 -135.835938 36.234375 -130.765625 C 36.234375 -123.929688 36.003906 -116.800781 35.546875 -109.375 C 35.160156 -102.28125 35 -95.148438 35.0625 -87.984375 L 35.15625 -79.390625 C 40.5 -86.554688 46.210938 -91.910156 52.296875 -95.453125 C 58.378906 -99.003906 64.84375 -100.78125 71.6875 -100.78125 C 82.488281 -100.78125 89.910156 -97.265625 93.953125 -90.234375 C 96.816406 -85.285156 98.441406 -76.953125 98.828125 -65.234375 L 99.609375 -46.578125 L 101.5625 -26.265625 C 102.476562 -18.648438 103.585938 -11.945312 104.890625 -6.15625 C 105.148438 -5.050781 105.28125 -4.109375 105.28125 -3.328125 C 105.28125 -0.648438 104.300781 1.582031 102.34375 3.375 C 100.394531 5.164062 98.050781 6.0625 95.3125 6.0625 Z M 95.3125 6.0625 "/>
</symbol>
<symbol overflow="visible" id="glyph0-3">
<path style="stroke:none;" d="M 32.234375 -123.640625 C 29.109375 -123.640625 26.40625 -124.742188 24.125 -126.953125 C 21.84375 -129.171875 20.703125 -131.84375 20.703125 -134.96875 C 20.703125 -138.09375 21.84375 -140.757812 24.125 -142.96875 C 26.40625 -145.1875 29.109375 -146.296875 32.234375 -146.296875 C 35.359375 -146.296875 38.039062 -145.1875 40.28125 -142.96875 C 42.53125 -140.757812 43.65625 -138.09375 43.65625 -134.96875 C 43.65625 -131.84375 42.53125 -129.171875 40.28125 -126.953125 C 38.039062 -124.742188 35.359375 -123.640625 32.234375 -123.640625 Z M 36.625 -44.34375 C 36.625 -40.4375 36.738281 -34.59375 36.96875 -26.8125 C 37.195312 -19.03125 37.3125 -13.1875 37.3125 -9.28125 C 37.3125 -6.414062 36.429688 -4.070312 34.671875 -2.25 C 32.910156 -0.425781 30.597656 0.484375 27.734375 0.484375 C 24.929688 0.484375 22.632812 -0.425781 20.84375 -2.25 C 19.0625 -4.070312 18.171875 -6.414062 18.171875 -9.28125 C 18.171875 -13.1875 18.054688 -19.03125 17.828125 -26.8125 C 17.597656 -34.59375 17.484375 -40.4375 17.484375 -44.34375 C 17.484375 -50.457031 17.804688 -58.085938 18.453125 -67.234375 C 19.109375 -76.378906 19.4375 -84.015625 19.4375 -90.140625 C 19.4375 -93.066406 20.332031 -95.441406 22.125 -97.265625 C 23.914062 -99.085938 26.207031 -100 29 -100 C 31.800781 -100 34.097656 -99.085938 35.890625 -97.265625 C 37.679688 -95.441406 38.578125 -93.066406 38.578125 -90.140625 C 38.578125 -84.015625 38.25 -76.378906 37.59375 -67.234375 C 36.945312 -58.085938 36.625 -50.457031 36.625 -44.34375 Z M 36.625 -44.34375 "/>
</symbol>
<symbol overflow="visible" id="glyph0-4">
<path style="stroke:none;" d="M 88.484375 6.9375 C 82.878906 6.9375 79.71875 3.875 79 -2.25 L 76.265625 -23.640625 C 75.359375 -31.253906 74.90625 -38.378906 74.90625 -45.015625 C 74.90625 -46.835938 75.019531 -49.929688 75.25 -54.296875 C 75.476562 -58.660156 75.59375 -61.753906 75.59375 -63.578125 C 75.59375 -77.640625 72.988281 -84.671875 67.78125 -84.671875 C 60.488281 -84.671875 53.519531 -80.34375 46.875 -71.6875 C 40.882812 -63.800781 36.195312 -53.835938 32.8125 -41.796875 C 32.6875 -39.253906 32.394531 -36.066406 31.9375 -32.234375 C 31.539062 -28.972656 31.34375 -25.8125 31.34375 -22.75 C 31.34375 -20.800781 31.535156 -17.875 31.921875 -13.96875 C 32.316406 -10.0625 32.515625 -7.128906 32.515625 -5.171875 C 32.515625 -2.242188 31.617188 0.128906 29.828125 1.953125 C 28.046875 3.773438 25.753906 4.6875 22.953125 4.6875 C 20.085938 4.6875 17.773438 3.773438 16.015625 1.953125 C 14.253906 0.128906 13.375 -2.242188 13.375 -5.171875 C 13.375 -7.128906 13.160156 -10.0625 12.734375 -13.96875 C 12.316406 -17.875 12.109375 -20.800781 12.109375 -22.75 C 12.109375 -29.457031 12.578125 -38.75 13.515625 -50.625 C 14.460938 -62.507812 14.9375 -71.804688 14.9375 -78.515625 C 14.9375 -80.597656 14.820312 -83.691406 14.59375 -87.796875 C 14.375 -91.898438 14.265625 -94.992188 14.265625 -97.078125 C 14.265625 -99.867188 15.191406 -102.160156 17.046875 -103.953125 C 18.898438 -105.742188 21.191406 -106.640625 23.921875 -106.640625 C 29.910156 -106.640625 33.203125 -102.410156 33.796875 -93.953125 L 34.078125 -82.515625 C 45.015625 -97.097656 56.25 -104.390625 67.78125 -104.390625 C 78.195312 -104.390625 85.453125 -99.800781 89.546875 -90.625 C 92.347656 -84.507812 93.878906 -75.460938 94.140625 -63.484375 L 94.140625 -53.609375 L 94.046875 -44.53125 C 94.046875 -39.125 94.742188 -32.140625 96.140625 -23.578125 C 97.546875 -15.023438 98.25 -8.078125 98.25 -2.734375 C 98.25 0.128906 97.316406 2.457031 95.453125 4.25 C 93.597656 6.039062 91.273438 6.9375 88.484375 6.9375 Z M 88.484375 6.9375 "/>
</symbol>
<symbol overflow="visible" id="glyph0-5">
<path style="stroke:none;" d="M 59.1875 4.5 C 44.46875 4.5 32.550781 0.816406 23.4375 -6.546875 C 13.476562 -14.679688 8.5 -26.070312 8.5 -40.71875 C 8.5 -57.644531 12.597656 -71.835938 20.796875 -83.296875 C 29.722656 -95.796875 41.640625 -102.046875 56.546875 -102.046875 C 67.347656 -102.046875 76.171875 -100.222656 83.015625 -96.578125 C 91.410156 -92.085938 95.609375 -85.1875 95.609375 -75.875 C 95.609375 -69.363281 91.929688 -63.441406 84.578125 -58.109375 C 81.316406 -55.765625 74.414062 -52.117188 63.875 -47.171875 L 26.5625 -29.5 C 30.207031 -24.09375 34.75 -20.019531 40.1875 -17.28125 C 45.625 -14.550781 51.957031 -13.1875 59.1875 -13.1875 C 63.675781 -13.1875 68.945312 -14.03125 75 -15.71875 C 82.6875 -17.875 87.632812 -20.691406 89.84375 -24.171875 C 92.0625 -27.648438 94.4375 -29.390625 96.96875 -29.390625 C 99.25 -29.390625 101.285156 -28.523438 103.078125 -26.796875 C 104.867188 -25.078125 105.765625 -23.078125 105.765625 -20.796875 C 105.765625 -13.578125 99.9375 -7.363281 88.28125 -2.15625 C 78.320312 2.28125 68.625 4.5 59.1875 4.5 Z M 56.546875 -84.46875 C 48.597656 -84.46875 41.988281 -81.390625 36.71875 -75.234375 C 31.445312 -69.085938 27.507812 -59.832031 24.90625 -47.46875 L 54.890625 -61.71875 C 66.671875 -67.445312 75.066406 -72.425781 80.078125 -76.65625 C 74.484375 -81.863281 66.640625 -84.46875 56.546875 -84.46875 Z M 56.546875 -84.46875 "/>
</symbol>
<symbol overflow="visible" id="glyph0-6">
<path style="stroke:none;" d="M 79.5 -75.203125 C 75.914062 -75.203125 73.40625 -76.40625 71.96875 -78.8125 C 71 -80.5 70.15625 -84.015625 69.4375 -89.359375 C 64.550781 -88.117188 57.03125 -85.835938 46.875 -82.515625 C 36.394531 -78.347656 31.125 -73.207031 31.0625 -67.09375 C 33.007812 -66.375 34.925781 -65.851562 36.8125 -65.53125 C 51.789062 -62.863281 62.925781 -59.1875 70.21875 -54.5 C 80.832031 -47.65625 86.140625 -37.757812 86.140625 -24.8125 C 86.140625 -14.195312 81.546875 -6.1875 72.359375 -0.78125 C 64.742188 3.644531 55.109375 5.859375 43.453125 5.859375 C 34.929688 5.859375 26.796875 4.425781 19.046875 1.5625 C 9.015625 -2.082031 4 -7.160156 4 -13.671875 C 4 -16.273438 5.023438 -18.550781 7.078125 -20.5 C 9.128906 -22.457031 11.457031 -23.4375 14.0625 -23.4375 C 16.082031 -23.4375 18.6875 -21.875 21.875 -18.75 C 23.4375 -17.25 26.953125 -16.015625 32.421875 -15.046875 C 36.785156 -14.265625 40.460938 -13.875 43.453125 -13.875 C 48.921875 -13.875 53.738281 -14.523438 57.90625 -15.828125 C 63.96875 -17.710938 67 -20.707031 67 -24.8125 C 67 -33.664062 60.8125 -39.65625 48.4375 -42.78125 L 38.28125 -45.015625 C 29.625 -46.910156 23.472656 -49.125 19.828125 -51.65625 C 14.554688 -55.300781 11.921875 -60.804688 11.921875 -68.171875 C 11.921875 -81.773438 18.332031 -91.472656 31.15625 -97.265625 C 35.0625 -99.023438 41.3125 -101.125 49.90625 -103.5625 C 58.5 -106.007812 64.648438 -108.078125 68.359375 -109.765625 C 71.023438 -110.941406 73.921875 -111.53125 77.046875 -111.53125 C 79.847656 -111.53125 82.144531 -110.617188 83.9375 -108.796875 C 85.726562 -106.972656 86.625 -104.59375 86.625 -101.65625 C 86.625 -99.769531 87.03125 -97.003906 87.84375 -93.359375 C 88.65625 -89.710938 89.0625 -86.945312 89.0625 -85.0625 C 89.0625 -82.132812 88.164062 -79.757812 86.375 -77.9375 C 84.582031 -76.113281 82.289062 -75.203125 79.5 -75.203125 Z M 79.5 -75.203125 "/>
</symbol>
<symbol overflow="visible" id="glyph0-7">
<path style="stroke:none;" d=""/>
</symbol>
<symbol overflow="visible" id="glyph1-0">
<path style="stroke:none;" d="M 20 24 L 180 24 L 180 -176 L 20 -176 Z M 100 -84.203125 L 36.40625 -166 L 163.59375 -166 Z M 106.40625 -76 L 170 -157.796875 L 170 5.796875 Z M 36.40625 14 L 100 -67.796875 L 163.59375 14 Z M 30 -157.796875 L 93.59375 -76 L 30 5.796875 Z M 30 -157.796875 "/>
</symbol>
<symbol overflow="visible" id="glyph1-1">
<path style="stroke:none;" d="M 60.796875 -144.203125 C 53.796875 -151.40625 38.796875 -160.203125 26.796875 -165.59375 L 18.40625 -154.796875 C 30.59375 -149 45.203125 -139.40625 52.203125 -132.40625 Z M 51 -92.59375 C 43.59375 -99.203125 28.59375 -107.40625 16.59375 -112.40625 L 8.203125 -101.40625 C 20.59375 -95.796875 35.40625 -87 42.40625 -80.40625 Z M 46 -60.40625 C 36.203125 -37.796875 23 -11.796875 13.59375 3.40625 L 26.59375 12.59375 C 36.796875 -6 48.59375 -30.59375 57.59375 -51.59375 Z M 84.59375 -79.59375 L 84.59375 -97.203125 L 116.203125 -97.203125 L 116.203125 -79.59375 Z M 163.59375 -97.203125 L 163.59375 -79.59375 L 130.40625 -79.59375 L 130.40625 -97.203125 Z M 103.59375 -140.796875 L 142.40625 -140.796875 L 142.40625 -127.203125 L 103.59375 -127.203125 Z M 189.59375 -21.203125 L 189.59375 -33 L 127 -33 C 128.40625 -37.40625 129.203125 -41.796875 129.796875 -46.203125 L 180.40625 -46.203125 L 180.40625 -57.796875 L 130.40625 -57.796875 L 130.40625 -69 L 178 -69 L 178 -107.59375 L 130.40625 -107.59375 L 130.40625 -116.796875 L 156.203125 -116.796875 L 156.203125 -140.796875 L 189.40625 -140.796875 L 189.40625 -152.796875 L 156.203125 -152.796875 L 156.203125 -167.796875 L 142.40625 -167.796875 L 142.40625 -152.796875 L 103.59375 -152.796875 L 103.59375 -167.796875 L 90.203125 -167.796875 L 90.203125 -152.796875 L 61.203125 -152.796875 L 61.203125 -140.796875 L 90.203125 -140.796875 L 90.203125 -116.796875 L 116.203125 -116.796875 L 116.203125 -107.59375 L 71 -107.59375 L 71 -69 L 116.203125 -69 L 116.203125 -57.796875 L 68.59375 -57.796875 L 68.59375 -46.203125 L 115.40625 -46.203125 C 114.796875 -41.796875 113.796875 -37.40625 112 -33 L 59.796875 -33 L 59.796875 -21.203125 L 105.203125 -21.203125 C 96.796875 -10.796875 82 -1.796875 56.40625 4 C 59.40625 6.796875 63.40625 12.40625 65 15.40625 C 96.796875 7 113.59375 -6.203125 122 -21.203125 L 124.203125 -21.203125 C 135.796875 -1.796875 156.40625 10.40625 184.40625 15.59375 C 186.203125 11.796875 190 6.203125 193 3.203125 C 169 0 150.203125 -8 139.203125 -21.203125 Z M 189.59375 -21.203125 "/>
</symbol>
<symbol overflow="visible" id="glyph2-0">
<path style="stroke:none;" d="M 25 0 L 25 -125 L 125 -125 L 125 0 Z M 28.125 -3.125 L 121.875 -3.125 L 121.875 -121.875 L 28.125 -121.875 Z M 28.125 -3.125 "/>
</symbol>
<symbol overflow="visible" id="glyph2-1">
<path style="stroke:none;" d="M 112.5 -60.0625 L 112.5 -33.40625 L 101.375 -26.375 L 115.234375 0 L 78.8125 0 L 74.03125 -8.796875 C 61.789062 -0.710938 50.203125 3.328125 39.265625 3.328125 C 27.804688 3.328125 18.984375 -0.476562 12.796875 -8.09375 C 6.609375 -15.71875 3.515625 -24.898438 3.515625 -35.640625 C 3.515625 -44.234375 5.335938 -50.972656 8.984375 -55.859375 C 12.628906 -60.742188 18.097656 -64.71875 25.390625 -67.78125 C 14.972656 -75.257812 9.765625 -85.378906 9.765625 -98.140625 C 9.765625 -109.148438 13.472656 -118.003906 20.890625 -124.703125 C 28.316406 -131.410156 38.539062 -134.765625 51.5625 -134.765625 C 63.28125 -134.765625 72.507812 -131.476562 79.25 -124.90625 C 85.988281 -118.332031 89.359375 -109.96875 89.359375 -99.8125 C 89.359375 -89.132812 85.253906 -79.660156 77.046875 -71.390625 L 91.015625 -46.1875 Z M 51.65625 -87.796875 C 56.082031 -93.585938 58.296875 -99.117188 58.296875 -104.390625 C 58.296875 -106.671875 57.644531 -108.753906 56.34375 -110.640625 C 55.039062 -112.535156 53.21875 -113.484375 50.875 -113.484375 C 48.726562 -113.484375 47.101562 -112.765625 46 -111.328125 C 44.894531 -109.898438 44.34375 -107.71875 44.34375 -104.78125 C 44.34375 -98.664062 46.78125 -93.003906 51.65625 -87.796875 Z M 60.546875 -26.65625 L 47.75 -47.953125 C 42.875 -43.523438 40.4375 -38.738281 40.4375 -33.59375 C 40.4375 -29.882812 41.195312 -27.101562 42.71875 -25.25 C 44.25 -23.394531 46.515625 -22.46875 49.515625 -22.46875 C 52.703125 -22.46875 56.378906 -23.863281 60.546875 -26.65625 Z M 60.546875 -26.65625 "/>
</symbol>
<symbol overflow="visible" id="glyph2-2">
<path style="stroke:none;" d=""/>
</symbol>
<symbol overflow="visible" id="glyph2-3">
<path style="stroke:none;" d="M 8.203125 -158.109375 L 76.765625 -158.109375 L 76.765625 -126.46875 L 49.3125 -126.46875 L 49.3125 -96.484375 L 75 -96.484375 L 75 -66.40625 L 49.3125 -66.40625 L 49.3125 -31.640625 L 79.5 -31.640625 L 79.5 0 L 8.203125 0 Z M 8.203125 -158.109375 "/>
</symbol>
<symbol overflow="visible" id="glyph2-4">
<path style="stroke:none;" d="M 47.171875 -129.59375 L 46.484375 -117.671875 C 49.347656 -122.429688 52.847656 -126 56.984375 -128.375 C 61.117188 -130.75 65.890625 -131.9375 71.296875 -131.9375 C 78.066406 -131.9375 83.597656 -130.335938 87.890625 -127.140625 C 92.191406 -123.953125 94.957031 -119.929688 96.1875 -115.078125 C 97.425781 -110.234375 98.046875 -102.148438 98.046875 -90.828125 L 98.046875 0 L 58.59375 0 L 58.59375 -89.75 C 58.59375 -98.664062 58.300781 -104.097656 57.71875 -106.046875 C 57.132812 -108.003906 55.503906 -108.984375 52.828125 -108.984375 C 50.035156 -108.984375 48.28125 -107.859375 47.5625 -105.609375 C 46.84375 -103.367188 46.484375 -97.363281 46.484375 -87.59375 L 46.484375 0 L 7.03125 0 L 7.03125 -129.59375 Z M 47.171875 -129.59375 "/>
</symbol>
<symbol overflow="visible" id="glyph2-5">
<path style="stroke:none;" d="M 96.6875 -129.59375 L 96.6875 -29.78125 C 96.6875 -16.3125 96.375 -7.601562 95.75 -3.65625 C 95.132812 0.28125 92.9375 4.445312 89.15625 8.84375 C 85.382812 13.238281 80.128906 16.585938 73.390625 18.890625 C 66.648438 21.203125 58.171875 22.359375 47.953125 22.359375 C 35.390625 22.359375 25.296875 20.226562 17.671875 15.96875 C 10.054688 11.707031 6.117188 3.320312 5.859375 -9.1875 L 44.140625 -9.1875 C 44.140625 -3.457031 46.222656 -0.59375 50.390625 -0.59375 C 53.390625 -0.59375 55.375 -1.46875 56.34375 -3.21875 C 57.320312 -4.976562 57.8125 -8.660156 57.8125 -14.265625 L 57.8125 -24.03125 C 54.425781 -20.96875 50.859375 -18.65625 47.109375 -17.09375 C 43.367188 -15.53125 39.453125 -14.75 35.359375 -14.75 C 28.253906 -14.75 22.40625 -16.179688 17.8125 -19.046875 C 13.226562 -21.910156 10.085938 -25.671875 8.390625 -30.328125 C 6.703125 -34.984375 5.859375 -41.609375 5.859375 -50.203125 L 5.859375 -97.265625 C 5.859375 -109.566406 8.070312 -118.421875 12.5 -123.828125 C 16.925781 -129.234375 23.664062 -131.9375 32.71875 -131.9375 C 37.664062 -131.9375 42.171875 -130.925781 46.234375 -128.90625 C 50.304688 -126.882812 53.9375 -123.859375 57.125 -119.828125 L 59.96875 -129.59375 Z M 57.125 -95.21875 C 57.125 -101.144531 56.78125 -104.921875 56.09375 -106.546875 C 55.414062 -108.171875 53.90625 -108.984375 51.5625 -108.984375 C 49.28125 -108.984375 47.664062 -108.054688 46.71875 -106.203125 C 45.78125 -104.347656 45.3125 -100.6875 45.3125 -95.21875 L 45.3125 -51.65625 C 45.3125 -45.863281 45.671875 -42.101562 46.390625 -40.375 C 47.109375 -38.65625 48.601562 -37.796875 50.875 -37.796875 C 53.476562 -37.796875 55.171875 -38.835938 55.953125 -40.921875 C 56.734375 -43.003906 57.125 -47.722656 57.125 -55.078125 Z M 57.125 -95.21875 "/>
</symbol>
<symbol overflow="visible" id="glyph2-6">
<path style="stroke:none;" d="M 47.65625 -158.109375 L 47.65625 0 L 7.03125 0 L 7.03125 -158.109375 Z M 47.65625 -158.109375 "/>
</symbol>
<symbol overflow="visible" id="glyph2-7">
<path style="stroke:none;" d="M 47.65625 -158.109375 L 47.65625 -137.5 L 7.03125 -137.5 L 7.03125 -158.109375 Z M 47.65625 -129.59375 L 47.65625 0 L 7.03125 0 L 7.03125 -129.59375 Z M 47.65625 -129.59375 "/>
</symbol>
<symbol overflow="visible" id="glyph2-8">
<path style="stroke:none;" d="M 87.59375 -88.1875 L 52.640625 -88.1875 L 52.640625 -95.21875 C 52.640625 -101.207031 52.296875 -105 51.609375 -106.59375 C 50.929688 -108.1875 49.222656 -108.984375 46.484375 -108.984375 C 44.273438 -108.984375 42.613281 -108.25 41.5 -106.78125 C 40.394531 -105.320312 39.84375 -103.128906 39.84375 -100.203125 C 39.84375 -96.222656 40.117188 -93.304688 40.671875 -91.453125 C 41.222656 -89.597656 42.882812 -87.5625 45.65625 -85.34375 C 48.425781 -83.132812 54.109375 -79.914062 62.703125 -75.6875 C 74.160156 -70.082031 81.675781 -64.804688 85.25 -59.859375 C 88.832031 -54.910156 90.625 -47.71875 90.625 -38.28125 C 90.625 -27.738281 89.253906 -19.78125 86.515625 -14.40625 C 83.785156 -9.03125 79.210938 -4.894531 72.796875 -2 C 66.390625 0.894531 58.660156 2.34375 49.609375 2.34375 C 39.585938 2.34375 31.007812 0.78125 23.875 -2.34375 C 16.75 -5.46875 11.847656 -9.695312 9.171875 -15.03125 C 6.503906 -20.375 5.171875 -28.453125 5.171875 -39.265625 L 5.171875 -45.515625 L 40.140625 -45.515625 L 40.140625 -37.3125 C 40.140625 -30.34375 40.578125 -25.816406 41.453125 -23.734375 C 42.335938 -21.648438 44.082031 -20.609375 46.6875 -20.609375 C 49.476562 -20.609375 51.425781 -21.304688 52.53125 -22.703125 C 53.644531 -24.109375 54.203125 -27.054688 54.203125 -31.546875 C 54.203125 -37.734375 53.484375 -41.609375 52.046875 -43.171875 C 50.554688 -44.734375 42.910156 -49.351562 29.109375 -57.03125 C 17.515625 -63.539062 10.445312 -69.445312 7.90625 -74.75 C 5.375 -80.0625 4.109375 -86.363281 4.109375 -93.65625 C 4.109375 -104.007812 5.472656 -111.640625 8.203125 -116.546875 C 10.941406 -121.460938 15.582031 -125.253906 22.125 -127.921875 C 28.664062 -130.597656 36.265625 -131.9375 44.921875 -131.9375 C 53.515625 -131.9375 60.820312 -130.84375 66.84375 -128.65625 C 72.863281 -126.476562 77.484375 -123.597656 80.703125 -120.015625 C 83.929688 -116.441406 85.882812 -113.125 86.5625 -110.0625 C 87.25 -107 87.59375 -102.210938 87.59375 -95.703125 Z M 87.59375 -88.1875 "/>
</symbol>
<symbol overflow="visible" id="glyph2-9">
<path style="stroke:none;" d="M 46.484375 -158.109375 L 46.484375 -122.5625 C 49.867188 -125.6875 53.53125 -128.03125 57.46875 -129.59375 C 61.40625 -131.15625 65.625 -131.9375 70.125 -131.9375 C 77.019531 -131.9375 82.890625 -130.175781 87.734375 -126.65625 C 92.585938 -123.144531 95.550781 -119.09375 96.625 -114.5 C 97.707031 -109.914062 98.25 -101.535156 98.25 -89.359375 L 98.25 0 L 58.796875 0 L 58.796875 -91.21875 C 58.796875 -98.769531 58.421875 -103.617188 57.671875 -105.765625 C 56.921875 -107.910156 55.242188 -108.984375 52.640625 -108.984375 C 50.234375 -108.984375 48.601562 -107.875 47.75 -105.65625 C 46.90625 -103.445312 46.484375 -99.054688 46.484375 -92.484375 L 46.484375 0 L 7.03125 0 L 7.03125 -158.109375 Z M 46.484375 -158.109375 "/>
</symbol>
</g>
</defs>
<g id="surface5">
<g fill="#000000">
  <use xlink:href="#glyph0-1" x="0" y="232"/>
  <use xlink:href="#glyph0-2" x="120.507812" y="232"/>
  <use xlink:href="#glyph0-3" x="236.035156" y="232"/>
  <use xlink:href="#glyph0-4" x="292.089844" y="232"/>
  <use xlink:href="#glyph0-5" x="396.777344" y="232"/>
  <use xlink:href="#glyph0-6" x="506.347656" y="232"/>
  <use xlink:href="#glyph0-5" x="603.710938" y="232"/>
  <use xlink:href="#glyph0-7" x="713.28125" y="232"/>
</g>
<g fill="#000000">
  <use xlink:href="#glyph1-1" x="773.046875" y="232"/>
</g>
<g fill="#000000">
  <use xlink:href="#glyph2-1" x="111.328125" y="497.757812"/>
  <use xlink:href="#glyph2-2" x="226.5625" y="497.757812"/>
  <use xlink:href="#glyph2-3" x="261.816406" y="497.757812"/>
  <use xlink:href="#glyph2-4" x="344.921875" y="497.757812"/>
  <use xlink:href="#glyph2-5" x="449.511719" y="497.757812"/>
  <use xlink:href="#glyph2-6" x="553.222656" y="497.757812"/>
  <use xlink:href="#glyph2-7" x="608.007812" y="497.757812"/>
  <use xlink:href="#glyph2-8" x="662.792969" y="497.757812"/>
  <use xlink:href="#glyph2-9" x="756.933594" y="497.757812"/>
</g>
</g>
</svg>

Below is the JavaScript I'm using to try and export the minimum bounding box.

paper.setup(new paper.Size(600, 600));
paper.project.importSVG(svg);
var trimedSvg = paper.project.exportSVG({ bounds: 'content', asString: true });
console.log(trimedSvg);

The SVG returned from Paper looks like this.


<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="974" height="540"><defs><clipPath id="clip-1"><rect x="0" y="0" width="974" height="540" fill="none"></rect></clipPath><symbol viewBox="8.79688,-148.73437,108.6875,151.07813" id="symbol-1"><g id="glyph0-1" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M107.8125,-109.57812c-4.16797,0 -7.29297,-2.4375 -9.375,-7.3125c-1.82422,-4.16406 -3.51562,-6.70703 -5.07812,-7.625c-1.36719,-0.71875 -4.75,-1.07812 -10.15625,-1.07812c-9.4375,0 -19.91797,7.23047 -31.4375,21.6875c-15.625,19.39844 -23.4375,37.78906 -23.4375,55.17188c0,8.39844 2.69531,15.625 8.09375,21.6875c5.53906,6.25 12.21875,9.375 20.03125,9.375c6.69531,0 13.42969,-1.72656 20.20313,-5.1875c3.78125,-1.94531 9.57813,-5.78516 17.39063,-11.51562c3.70703,-2.73828 6.50391,-4.10937 8.39063,-4.10937c2.80078,0 5.14453,1.0625 7.03125,3.1875c1.89453,2.11719 2.84375,4.47656 2.84375,7.07813c0,2.92969 -1.24219,5.49609 -3.71875,7.70313c-17.1875,15.24219 -34.57031,22.85938 -52.14062,22.85938c-13.48047,0 -24.875,-5.17578 -34.1875,-15.53125c-8.98047,-10.01953 -13.46875,-21.86719 -13.46875,-35.54687c0,-22.07031 9.24219,-44.69531 27.73438,-67.875c15.42578,-19.33203 30.98438,-29 46.67188,-29c3.1875,0 6.05078,0.14844 8.59375,0.4375c2.53906,0.29297 4.78516,0.76563 6.73438,1.42188c2.28125,-3.32031 5.24219,-4.98437 8.89063,-4.98437c4.48828,0 7.32031,2.96484 8.5,8.89063c1.03906,5.27344 1.5625,11.75 1.5625,19.4375c0,2.66797 -0.71875,5.01172 -2.15625,7.03125c-1.75,2.53125 -4.25781,3.79688 -7.51562,3.79688zM107.8125,-109.57812"></path></g></symbol><symbol viewBox="14.15625,-156.45312,91.125,162.51563" id="symbol-2"><g id="glyph0-2" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M95.3125,6.0625c-4.625,0 -7.65234,-2.48047 -9.07812,-7.4375c-1.5,-5.33203 -2.87109,-12.91406 -4.10937,-22.75c-1.16797,-9.4375 -1.75,-17.17969 -1.75,-23.23437c0,-1.69531 0.07813,-4.26953 0.23438,-7.71875c0.16406,-3.44531 0.25,-6.01953 0.25,-7.71875c0,-12.23828 -3.05859,-18.35937 -9.17187,-18.35937c-8.27344,0 -15.66406,3.74609 -22.17187,11.23438c-3.32422,3.84375 -7.88281,11.16797 -13.67187,21.96875c0,24.80469 -1.04297,39.48438 -3.125,44.04688c-1.82422,4.03906 -4.65625,6.0625 -8.5,6.0625c-2.66797,0 -5.01172,-0.91406 -7.03125,-2.73437c-2.02344,-1.83203 -3.03125,-4.05078 -3.03125,-6.65625c0,-0.90625 0.29688,-2.33594 0.89063,-4.29687c0.51953,-1.625 0.875,-6.375 1.0625,-14.25l0.29688,-14.45312l0.29688,-71.78125c0.45703,-8.07031 0.6875,-13.50781 0.6875,-16.3125c0,-3.3125 -0.3125,-6.44531 -0.9375,-9.40625c-0.61719,-2.96875 -0.92187,-6.04687 -0.92187,-9.23437c0,-2.73828 0.94141,-5.00391 2.82813,-6.79687c1.88281,-1.78906 4.19531,-2.6875 6.9375,-2.6875c5.33203,0 8.45703,2.86719 9.375,8.59375c1.03906,6.32422 1.5625,12.02344 1.5625,17.09375c0,6.83594 -0.23047,13.96484 -0.6875,21.39063c-0.38672,7.09375 -0.54687,14.22656 -0.48437,21.39063l0.09375,8.59375c5.34375,-7.16406 11.05469,-12.51953 17.14063,-16.0625c6.08203,-3.55078 12.54688,-5.32812 19.39063,-5.32812c10.80078,0 18.22266,3.51563 22.26563,10.54688c2.86328,4.94922 4.48828,13.28125 4.875,25l0.78125,18.65625l1.95313,20.3125c0.91406,7.61719 2.02344,14.32031 3.32813,20.10938c0.25781,1.10547 0.39063,2.04688 0.39063,2.82813c0,2.67969 -0.98047,4.91016 -2.9375,6.70313c-1.94922,1.78906 -4.29297,2.6875 -7.03125,2.6875zM95.3125,6.0625"></path></g></symbol><symbol viewBox="17.48438,-146.29687,26.17188,146.78125" id="symbol-3"><g id="glyph0-3" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M32.23438,-123.64062c-3.125,0 -5.82812,-1.10156 -8.10937,-3.3125c-2.28125,-2.21875 -3.42187,-4.89062 -3.42187,-8.01562c0,-3.125 1.14063,-5.78906 3.42188,-8c2.28125,-2.21875 4.98438,-3.32812 8.10938,-3.32812c3.125,0 5.80469,1.10938 8.04688,3.32813c2.25,2.21094 3.375,4.875 3.375,8c0,3.125 -1.125,5.79688 -3.375,8.01563c-2.24219,2.21094 -4.92187,3.3125 -8.04687,3.3125zM36.625,-44.34375c0,3.90625 0.11328,9.75 0.34375,17.53125c0.22656,7.78125 0.34375,13.625 0.34375,17.53125c0,2.86719 -0.88281,5.21094 -2.64062,7.03125c-1.76172,1.82422 -4.07422,2.73438 -6.9375,2.73438c-2.80469,0 -5.10156,-0.91016 -6.89062,-2.73437c-1.78125,-1.82031 -2.67187,-4.16406 -2.67187,-7.03125c0,-3.90625 -0.11719,-9.75 -0.34375,-17.53125c-0.23047,-7.78125 -0.34375,-13.625 -0.34375,-17.53125c0,-6.11328 0.32031,-13.74219 0.96875,-22.89062c0.65625,-9.14453 0.98438,-16.78125 0.98438,-22.90625c0,-2.92578 0.89453,-5.30078 2.6875,-7.125c1.78906,-1.82031 4.08203,-2.73437 6.875,-2.73437c2.80078,0 5.09766,0.91406 6.89063,2.73438c1.78906,1.82422 2.6875,4.19922 2.6875,7.125c0,6.125 -0.32812,13.76172 -0.98437,22.90625c-0.64844,9.14844 -0.96875,16.77734 -0.96875,22.89063zM36.625,-44.34375"></path></g></symbol><symbol viewBox="12.10938,-106.64062,86.14063,113.57813" id="symbol-4"><g id="glyph0-4" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M88.48438,6.9375c-5.60547,0 -8.76562,-3.0625 -9.48437,-9.1875l-2.73437,-21.39062c-0.90625,-7.61328 -1.35937,-14.73828 -1.35937,-21.375c0,-1.82031 0.11328,-4.91406 0.34375,-9.28125c0.22656,-4.36328 0.34375,-7.45703 0.34375,-9.28125c0,-14.0625 -2.60547,-21.09375 -7.8125,-21.09375c-7.29297,0 -14.26172,4.32813 -20.90625,12.98438c-5.99219,7.88672 -10.67969,17.85156 -14.0625,29.89063c-0.125,2.54297 -0.41797,5.73047 -0.875,9.5625c-0.39844,3.26172 -0.59375,6.42188 -0.59375,9.48438c0,1.94922 0.19141,4.875 0.57813,8.78125c0.39453,3.90625 0.59375,6.83984 0.59375,8.79688c0,2.92969 -0.89844,5.30078 -2.6875,7.125c-1.78125,1.82031 -4.07422,2.73438 -6.875,2.73438c-2.86719,0 -5.17969,-0.91406 -6.9375,-2.73437c-1.76172,-1.82422 -2.64062,-4.19531 -2.64062,-7.125c0,-1.95703 -0.21484,-4.89062 -0.64062,-8.79687c-0.41797,-3.90625 -0.625,-6.83203 -0.625,-8.78125c0,-6.70703 0.46875,-16 1.40625,-27.875c0.94531,-11.88281 1.42188,-21.17969 1.42188,-27.89062c0,-2.08203 -0.11719,-5.17578 -0.34375,-9.28125c-0.21875,-4.10156 -0.32812,-7.19531 -0.32812,-9.28125c0,-2.78906 0.92578,-5.08203 2.78125,-6.875c1.85156,-1.78906 4.14453,-2.6875 6.875,-2.6875c5.98828,0 9.28125,4.23047 9.875,12.6875l0.28125,11.4375c10.9375,-14.58203 22.17188,-21.875 33.70313,-21.875c10.41406,0 17.67188,4.58984 21.76563,13.76563c2.80078,6.11719 4.33203,15.16406 4.59375,27.14063v9.875l-0.09375,9.07813c0,5.40625 0.69531,12.39063 2.09375,20.95313c1.40625,8.55469 2.10938,15.5 2.10938,20.84375c0,2.86328 -0.93359,5.19141 -2.79687,6.98438c-1.85547,1.78906 -4.17969,2.6875 -6.96875,2.6875zM88.48438,6.9375"></path></g></symbol><symbol viewBox="8.5,-102.04687,97.26563,106.54688" id="symbol-5"><g id="glyph0-5" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M59.1875,4.5c-14.71875,0 -26.63672,-3.68359 -35.75,-11.04687c-9.96094,-8.13281 -14.9375,-19.52344 -14.9375,-34.17187c0,-16.92578 4.09766,-31.11719 12.29688,-42.57812c8.92578,-12.5 20.84375,-18.75 35.75,-18.75c10.80078,0 19.625,1.82422 26.46875,5.46875c8.39453,4.49219 12.59375,11.39063 12.59375,20.70313c0,6.51172 -3.67969,12.43359 -11.03125,17.76563c-3.26172,2.34375 -10.16406,5.99219 -20.70312,10.9375l-37.3125,17.67188c3.64453,5.40625 8.1875,9.48047 13.625,12.21875c5.4375,2.73047 11.76953,4.09375 19,4.09375c4.48828,0 9.75781,-0.84375 15.8125,-2.53125c7.6875,-2.15625 12.63281,-4.97266 14.84375,-8.45312c2.21875,-3.47656 4.59375,-5.21875 7.125,-5.21875c2.28125,0 4.31641,0.86719 6.10938,2.59375c1.78906,1.71875 2.6875,3.71875 2.6875,6c0,7.21875 -5.82812,13.43359 -17.48437,18.64063c-9.96094,4.4375 -19.65625,6.65625 -29.09375,6.65625zM56.54688,-84.46875c-7.94922,0 -14.55859,3.07813 -19.82812,9.23438c-5.27344,6.14844 -9.21094,15.40234 -11.8125,27.76563l29.98438,-14.25c11.78125,-5.72656 20.17578,-10.70703 25.1875,-14.9375c-5.59375,-5.20703 -13.4375,-7.8125 -23.53125,-7.8125zM56.54688,-84.46875"></path></g></symbol><symbol viewBox="4,-111.53125,85.0625,117.39063" id="symbol-6"><g id="glyph0-6" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M79.5,-75.20312c-3.58594,0 -6.09375,-1.20312 -7.53125,-3.60937c-0.96875,-1.6875 -1.8125,-5.20312 -2.53125,-10.54687c-4.88672,1.24219 -12.40625,3.52344 -22.5625,6.84375c-10.48047,4.16797 -15.75,9.30859 -15.8125,15.42188c1.94531,0.71875 3.86328,1.24219 5.75,1.5625c14.97656,2.66797 26.11328,6.34375 33.40625,11.03125c10.61328,6.84375 15.92188,16.74219 15.92188,29.6875c0,10.61719 -4.59375,18.625 -13.78125,24.03125c-7.61719,4.42578 -17.25,6.64063 -28.90625,6.64063c-8.52344,0 -16.65625,-1.43359 -24.40625,-4.29687c-10.03125,-3.64453 -15.04687,-8.72266 -15.04687,-15.23437c0,-2.60156 1.02344,-4.87891 3.07813,-6.82812c2.05078,-1.95703 4.37891,-2.9375 6.98438,-2.9375c2.01953,0 4.625,1.5625 7.8125,4.6875c1.5625,1.5 5.07813,2.73438 10.54688,3.70313c4.36328,0.78125 8.03906,1.17188 11.03125,1.17188c5.46875,0 10.28516,-0.64844 14.45313,-1.95312c6.0625,-1.88281 9.09375,-4.87891 9.09375,-8.98437c0,-8.85156 -6.1875,-14.84375 -18.5625,-17.96875l-10.15625,-2.23437c-8.65625,-1.89453 -14.80859,-4.10937 -18.45312,-6.64062c-5.27344,-3.64453 -7.90625,-9.14844 -7.90625,-16.51562c0,-13.60156 6.41016,-23.30078 19.23438,-29.09375c3.90625,-1.75781 10.15625,-3.85937 18.75,-6.29687c8.59375,-2.44531 14.74219,-4.51562 18.45313,-6.20312c2.66406,-1.17578 5.5625,-1.76562 8.6875,-1.76562c2.80078,0 5.09766,0.91406 6.89063,2.73438c1.78906,1.82422 2.6875,4.20313 2.6875,7.14063c0,1.88672 0.40625,4.65234 1.21875,8.29688c0.8125,3.64844 1.21875,6.41406 1.21875,8.29688c0,2.92969 -0.89844,5.30469 -2.6875,7.125c-1.79297,1.82422 -4.08594,2.73438 -6.875,2.73438zM79.5,-75.20312"></path></g></symbol><symbol viewBox="0,0,0,0" id="symbol-7"><g id="glyph0-7" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d=""></path></g></symbol><symbol viewBox="8.20313,-167.79687,184.79688,183.39063" id="symbol-8"><g id="glyph1-1" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M60.79688,-144.20312c-7,-7.20312 -22,-16 -34,-21.39062l-8.39062,10.79688c12.1875,5.79688 26.79688,15.39063 33.79688,22.39063zM51,-92.59375c-7.40625,-6.60937 -22.40625,-14.8125 -34.40625,-19.8125l-8.39062,11c12.39063,5.60938 27.20313,14.40625 34.20313,21zM46,-60.40625c-9.79687,22.60938 -23,48.60938 -32.40625,63.8125l13,9.1875c10.20313,-18.59375 22,-43.1875 31,-64.1875zM84.59375,-79.59375v-17.60937h31.60938v17.60938zM163.59375,-97.20312v17.60938h-33.1875v-17.60937zM103.59375,-140.79687h38.8125v13.59375h-38.8125zM189.59375,-21.20312v-11.79687h-62.59375c1.40625,-4.40625 2.20313,-8.79687 2.79688,-13.20312h50.60938v-11.59375h-50v-11.20312h47.59375v-38.59375h-47.59375v-9.20312h25.79688v-24h33.20313v-12h-33.20312v-15h-13.79687v15h-38.8125v-15h-13.39062v15h-29v12h29v24h26v9.20313h-45.20312v38.59375h45.20313v11.20313h-47.60937v11.59375h46.8125c-0.60937,4.40625 -1.60937,8.79688 -3.40625,13.20313h-52.20312v11.79688h45.40625c-8.40625,10.40625 -23.20312,19.40625 -48.79687,25.20313c3,2.79688 7,8.40625 8.59375,11.40625c31.79688,-8.40625 48.59375,-21.60937 57,-36.60937h2.20313c11.59375,19.40625 32.20313,31.60938 60.20313,36.79688c1.79688,-3.79687 5.59375,-9.39062 8.59375,-12.39062c-24,-3.20312 -42.79687,-11.20312 -53.79687,-24.40625zM189.59375,-21.20312"></path></g></symbol><symbol viewBox="3.51563,-134.76562,111.71875,138.09375" id="symbol-9"><g id="glyph2-1" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M112.5,-60.0625v26.65625l-11.125,7.03125l13.85938,26.375h-36.42187l-4.78125,-8.79687c-12.24219,8.08594 -23.82812,12.125 -34.76562,12.125c-11.46094,0 -20.28125,-3.80469 -26.46875,-11.42187c-6.1875,-7.625 -9.28125,-16.80469 -9.28125,-27.54687c0,-8.59375 1.82031,-15.33203 5.46875,-20.21875c3.64453,-4.88281 9.11328,-8.85937 16.40625,-11.92187c-10.41797,-7.47656 -15.625,-17.59766 -15.625,-30.35937c0,-11.00781 3.70703,-19.86328 11.125,-26.5625c7.42578,-6.70703 17.64844,-10.0625 30.67188,-10.0625c11.71875,0 20.94531,3.28906 27.6875,9.85938c6.73828,6.57422 10.10938,14.9375 10.10938,25.09375c0,10.67969 -4.10547,20.15234 -12.3125,28.42188l13.96875,25.20313zM51.65625,-87.79687c4.42578,-5.78906 6.64063,-11.32031 6.64063,-16.59375c0,-2.28125 -0.65234,-4.36328 -1.95312,-6.25c-1.30469,-1.89453 -3.125,-2.84375 -5.46875,-2.84375c-2.14844,0 -3.77344,0.71875 -4.875,2.15625c-1.10547,1.42969 -1.65625,3.60938 -1.65625,6.54688c0,6.11719 2.4375,11.77734 7.3125,16.98438zM60.54688,-26.65625l-12.79687,-21.29687c-4.875,4.42969 -7.3125,9.21484 -7.3125,14.35938c0,3.71094 0.75781,6.49219 2.28125,8.34375c1.53125,1.85547 3.79688,2.78125 6.79688,2.78125c3.1875,0 6.86328,-1.39453 11.03125,-4.1875zM60.54688,-26.65625"></path></g></symbol><symbol viewBox="0,0,0,0" id="symbol-10"><g id="glyph2-2" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d=""></path></g></symbol><symbol viewBox="8.20313,-158.10937,71.29688,158.10938" id="symbol-11"><g id="glyph2-3" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M8.20313,-158.10937h68.5625v31.64063h-27.45312v29.98438h25.6875v30.07813h-25.6875v34.76563h30.1875v31.64063h-71.29687zM8.20313,-158.10937"></path></g></symbol><symbol viewBox="7.03125,-131.9375,91.01563,131.9375" id="symbol-12"><g id="glyph2-4" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M47.17188,-129.59375l-0.6875,11.92188c2.86328,-4.75781 6.36328,-8.32812 10.5,-10.70312c4.13281,-2.375 8.90625,-3.5625 14.3125,-3.5625c6.76953,0 12.30078,1.60156 16.59375,4.79688c4.30078,3.1875 7.06641,7.21094 8.29688,12.0625c1.23828,4.84375 1.85938,12.92969 1.85938,24.25v90.82813h-39.45312v-89.75c0,-8.91406 -0.29297,-14.34766 -0.875,-16.29687c-0.58594,-1.95703 -2.21484,-2.9375 -4.89062,-2.9375c-2.79297,0 -4.54687,1.125 -5.26562,3.375c-0.71875,2.24219 -1.07812,8.24609 -1.07812,18.01563v87.59375h-39.45312v-129.59375zM47.17188,-129.59375"></path></g></symbol><symbol viewBox="5.85938,-131.9375,90.82813,154.29688" id="symbol-13"><g id="glyph2-5" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M96.6875,-129.59375v99.8125c0,13.46875 -0.3125,22.17969 -0.9375,26.125c-0.61719,3.9375 -2.8125,8.10156 -6.59375,12.5c-3.77344,4.39453 -9.02734,7.74219 -15.76562,10.04688c-6.74219,2.3125 -15.21875,3.46875 -25.4375,3.46875c-12.5625,0 -22.65625,-2.13281 -30.28125,-6.39062c-7.61719,-4.26172 -11.55469,-12.64844 -11.8125,-25.15625h38.28125c0,5.73047 2.08203,8.59375 6.25,8.59375c3,0 4.98438,-0.875 5.95313,-2.625c0.97656,-1.75781 1.46875,-5.44141 1.46875,-11.04687v-9.76562c-3.38672,3.0625 -6.95312,5.375 -10.70312,6.9375c-3.74219,1.5625 -7.65625,2.34375 -11.75,2.34375c-7.10547,0 -12.95312,-1.42969 -17.54687,-4.29687c-4.58594,-2.86328 -7.72656,-6.625 -9.42187,-11.28125c-1.6875,-4.65625 -2.53125,-11.28125 -2.53125,-19.875v-47.0625c0,-12.30078 2.21094,-21.15625 6.64063,-26.5625c4.42578,-5.40625 11.16406,-8.10937 20.21875,-8.10937c4.94531,0 9.45313,1.01172 13.51563,3.03125c4.07031,2.02344 7.70313,5.04688 10.89063,9.07813l2.84375,-9.76562zM57.125,-95.21875c0,-5.92578 -0.34375,-9.70312 -1.03125,-11.32812c-0.67969,-1.625 -2.1875,-2.4375 -4.53125,-2.4375c-2.28125,0 -3.89844,0.92969 -4.84375,2.78125c-0.9375,1.85547 -1.40625,5.51563 -1.40625,10.98438v43.5625c0,5.79297 0.35938,9.55469 1.07813,11.28125c0.71875,1.71875 2.21094,2.57813 4.48438,2.57813c2.60156,0 4.29688,-1.03906 5.07813,-3.125c0.78125,-2.08203 1.17188,-6.80078 1.17188,-14.15625zM57.125,-95.21875"></path></g></symbol><symbol viewBox="7.03125,-158.10937,40.625,158.10938" id="symbol-14"><g id="glyph2-6" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M47.65625,-158.10937v158.10938h-40.625v-158.10937zM47.65625,-158.10937"></path></g></symbol><symbol viewBox="7.03125,-158.10937,40.625,158.10938" id="symbol-15"><g id="glyph2-7" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M47.65625,-158.10937v20.60938h-40.625v-20.60937zM47.65625,-129.59375v129.59375h-40.625v-129.59375zM47.65625,-129.59375"></path></g></symbol><symbol viewBox="4.10938,-131.9375,86.51563,134.28125" id="symbol-16"><g id="glyph2-8" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M87.59375,-88.1875h-34.95312v-7.03125c0,-5.98828 -0.34375,-9.78125 -1.03125,-11.375c-0.67969,-1.59375 -2.38672,-2.39062 -5.125,-2.39062c-2.21094,0 -3.87109,0.73438 -4.98437,2.20313c-1.10547,1.46094 -1.65625,3.65234 -1.65625,6.57813c0,3.98047 0.27344,6.89844 0.82813,8.75c0.55078,1.85547 2.21094,3.89063 4.98438,6.10938c2.76953,2.21094 8.45313,5.42969 17.04688,9.65625c11.45703,5.60547 18.97266,10.88281 22.54688,15.82813c3.58203,4.94922 5.375,12.14063 5.375,21.57813c0,10.54297 -1.37109,18.5 -4.10937,23.875c-2.73047,5.375 -7.30469,9.51172 -13.71875,12.40625c-6.40625,2.89453 -14.13672,4.34375 -23.1875,4.34375c-10.02344,0 -18.60156,-1.5625 -25.73437,-4.6875c-7.125,-3.125 -12.02734,-7.35156 -14.70312,-12.6875c-2.66797,-5.34375 -4,-13.42187 -4,-24.23437v-6.25h34.96875v8.20313c0,6.96875 0.4375,11.49609 1.3125,13.57813c0.88281,2.08594 2.62891,3.125 5.23438,3.125c2.78906,0 4.73828,-0.69531 5.84375,-2.09375c1.11328,-1.40625 1.67188,-4.35156 1.67188,-8.84375c0,-6.1875 -0.71875,-10.0625 -2.15625,-11.625c-1.49219,-1.5625 -9.13672,-6.17969 -22.9375,-13.85937c-11.59375,-6.50781 -18.66406,-12.41406 -21.20312,-17.71875c-2.53125,-5.3125 -3.79687,-11.61328 -3.79687,-18.90625c0,-10.35156 1.36328,-17.98437 4.09375,-22.89062c2.73828,-4.91406 7.37891,-8.70703 13.92188,-11.375c6.53906,-2.67578 14.14063,-4.01562 22.79688,-4.01562c8.59375,0 15.89844,1.09375 21.92188,3.28125c6.01953,2.17969 10.64063,5.05859 13.85938,8.64063c3.22656,3.57422 5.17969,6.89063 5.85938,9.95313c0.6875,3.0625 1.03125,7.85156 1.03125,14.35938zM87.59375,-88.1875"></path></g></symbol><symbol viewBox="7.03125,-158.10937,91.21875,158.10938" id="symbol-17"><g id="glyph2-9" fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M46.48438,-158.10937v35.54688c3.38281,-3.125 7.04688,-5.46875 10.98438,-7.03125c3.9375,-1.5625 8.15625,-2.34375 12.65625,-2.34375c6.89453,0 12.76563,1.76172 17.60938,5.28125c4.85156,3.51172 7.81641,7.5625 8.89063,12.15625c1.08203,4.58594 1.625,12.96484 1.625,25.14063v89.35938h-39.45312v-91.21875c0,-7.55078 -0.375,-12.39844 -1.125,-14.54687c-0.75,-2.14453 -2.42969,-3.21875 -5.03125,-3.21875c-2.40625,0 -4.03906,1.10938 -4.89062,3.32813c-0.84375,2.21094 -1.26562,6.60156 -1.26562,13.17188v92.48438h-39.45312v-158.10937zM46.48438,-158.10937"></path></g></symbol></defs><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><g clip-path="url(#clip-1)"><g id="surface5" fill="#000000"><g><use x="8.79688" y="83.26563" href="#symbol-1" width="108.6875" height="151.07813" overflow="visible"></use><use x="134.66406" y="75.54688" href="#symbol-2" width="91.125" height="162.51563" overflow="visible"></use><use x="253.51953" y="85.70313" href="#symbol-3" width="26.17188" height="146.78125" overflow="visible"></use><use x="304.19922" y="125.35938" href="#symbol-4" width="86.14063" height="113.57813" overflow="visible"></use><use x="405.27734" y="129.95313" href="#symbol-5" width="97.26563" height="106.54688" overflow="visible"></use><use x="510.34766" y="120.46875" href="#symbol-6" width="85.0625" height="117.39063" overflow="visible"></use><use x="612.21094" y="129.95313" href="#symbol-5" width="97.26563" height="106.54688" overflow="visible"></use><use x="713.28125" y="232" href="#symbol-7" width="0" height="0" overflow="visible"></use></g><g><use x="781.25" y="64.20313" href="#symbol-8" width="184.79688" height="183.39063" overflow="visible"></use></g><g><use x="114.84375" y="362.99219" href="#symbol-9" width="111.71875" height="138.09375" overflow="visible"></use><use x="226.5625" y="497.75781" href="#symbol-10" width="0" height="0" overflow="visible"></use><use x="270.01953" y="339.64844" href="#symbol-11" width="71.29688" height="158.10938" overflow="visible"></use><use x="351.95313" y="365.82031" href="#symbol-12" width="91.01563" height="131.9375" overflow="visible"></use><use x="455.37109" y="365.82031" href="#symbol-13" width="90.82813" height="154.29688" overflow="visible"></use><use x="560.25391" y="339.64844" href="#symbol-14" width="40.625" height="158.10938" overflow="visible"></use><use x="615.03906" y="339.64844" href="#symbol-15" width="40.625" height="158.10938" overflow="visible"></use><use x="666.90234" y="365.82031" href="#symbol-16" width="86.51563" height="134.28125" overflow="visible"></use><use x="763.96484" y="339.64844" href="#symbol-17" width="91.21875" height="158.10938" overflow="visible"></use></g></g></g></g></svg>
adamdyson commented 7 years ago

It took me a while to figure out why nothing was visible, at first I thought it was because the orginal SVG wrapped the symbol elements in a <g>. But what fixed it was doing a bulk find/replace and removing the fill attribute fill="none" on the exported SVG.

adamdyson commented 7 years ago

I haven't looking into the code but it's as if the fill colour isn't inherited from the parent group, when no fill colour is defined for the symbols themselves.

iconexperience commented 7 years ago

I converted your svg into a one-liner and created a Sketch for testing

However, there is some text visible ("Chinese 漢 & English"). What would be the expected behaviour?

adamdyson commented 7 years ago

Personally I'm not seeing this, it may be because I'm using node with paper-jsdom? I've since started piping the each path as JSON via stdin for my particular use-case. I'm happy to close this issue you're satisfied the problem does not exist.

renschler commented 5 years ago

@iconexperience @adamdyson i think I'm running into a similar situation.

here's what the svg looks like (contains no raster images, just symbols, shapes, groups, and paths iirc) google_paris

and here's what it looks like in the one line svg in sketch

screen shot 2018-10-15 at 4 28 46 pm

Removing all references to fill:none on the export did not solve the problem.

The example is hard to follow bc it was an exported svg from a map service. If I can reproduce in a more simple example I will share.

But basically in sketch, what you see is the equivalent of taking the original SVG and removing the group withid="Line_artwork", that's the group that contains a bunch of <use> elements which reference symbols from earlier in the svg.

renschler commented 5 years ago

Update: I wonder if it has to do with the <use> element.

Here's a very simple svg example that fails in sketch:

`

`

Here's the SVG: screen shot 2018-10-15 at 4 47 52 pm

And here's what Sketch Looks like: screen shot 2018-10-15 at 4 47 57 pm

sapics commented 5 years ago

@renschler Thanks for simple example! When I open your svg in Illustrator and Inkscape, the results are same as sketch. So, it would not be a bug of the paperjs. I edit your sketch for getting your wish result. link I guess that we need to write svg more formal way, but sorry I don't know well about svg format.

renschler commented 5 years ago

interesting!

I'll addxmlns:xlink="http://www.w3.org/1999/xlink" to my map svg and change all the hrefs to xlink:hrefs and see if it works. (update in a comment below - it turns out my map svg already had this)

my example was pulled from here on MDN. It's their example code for the <use> element, so it's strange that this is not supported in illustrator or inkscape.

screen shot 2018-10-16 at 10 10 23 am

renschler commented 5 years ago

also @sapics in your example link the colors didn't come through, all the circles are black. Do you think that is a bug? screen shot 2018-10-16 at 10 14 21 am

renschler commented 5 years ago

so it turns out my map SVG already has the line xmlns:xlink="http://www.w3.org/1999/xlink" and it uses xlink:href as opposed to just href.

So I'm wondering if my issue is caused by the style on the <use> elements not being applied. Which is consistent with the example sketch @sapics provided.

I'll open this as a separate issue if others agree (this does not seem to be related to the Symbol issue this was originally filed for).

sapics commented 5 years ago

@renschler Oh, it's strange :) In my chrome and firefox in windows 10 and safari in iphone, it is not black. It might depends on svg parser of browser. Which browser do you check?

renschler commented 5 years ago

oh yeah you are right @sapics , i was using brave browser and i think the fingerprinting shields mess with canvas stuff. when I turned them off the style was applied correctly.

So I'm not sure what the issue is with my map svg, i guess it could be a symbol thing but no idea. It works in inkscape, and just opening the svg in a browser works, but not after import with paperjs. I'll try to find a simple example where I can reproduce it.