I have provided, as an example, an SVG of a lamp I created using Sketch. I intend for the lamp's head to scale by a factor (e.g. 1.2 here) when the cursor hovers over - to indicate interactivity. The issue is, however, when hovering over the lamp head its location is also transformed. Firstly, I'd like to know what the scale is using to base its transformation on - is it the other transforms, the positional values in the ellipses/paths?
Secondly, how can I go about ensuring that scaling occurs around the origin of the group () I am interested in?
I have tried to swap out the translates for x,y positions on the elements, as well as nesting svgs to no avail. I believe there's a fundamental piece of the svg framework here I'm not quite grasping.
.interactive:hover {
scale: 1.2;
}
<svg viewBox="0 0 1920 1080" version="1.1" xmlns="http://www.w3.org/2000/svg">
<svg>
<g fill="none" fill-rule="evenodd" transform="translate(0 .832)">
<path fill="#FCFC30" fill-opacity=".35"
d="M283.589311,155.632129 L373.36705,522.838236 C377.564302,540.005704 367.049864,557.325232 349.882396,561.522484 C347.399779,562.129455 344.853386,562.436827 342.297648,562.438029 L162.3966,562.522631 C144.72349,562.530942 130.389866,548.210793 130.381555,530.537683 C130.380345,527.962942 130.689882,525.397465 131.303454,522.896901 L221.426762,155.606192 C225.638338,138.442233 242.966634,127.942251 260.130594,132.153828 C271.714734,134.996266 280.756541,144.04562 283.589311,155.632129 Z"
transform="rotate(32 252.31 295.631)"></path>
/* This following group is the one to be made interactive */
<g fill-rule="nonzero" transform="translate(264.313 121.836)" class="interactive" cursor="pointer">
<ellipse fill="#EFCF6A" rx="17.298" ry="17.28" cx="41.1" cy="90.717"></ellipse>
<path fill="#E5DBDA"
d="M0,68.8755609 C0,68.8755609 23.9403854,39.015945 48.4343057,32.3804748 L89.5342738,57.6782049 C89.5342738,57.6782049 95.6231579,89.4731662 76.9413543,118.641587 L0,68.8755609 Z"></path>
<path fill="#E5DBDA"
d="M89.5342738,0.585513479 L97.5605301,5.2856382 C97.5605301,5.2856382 102.127193,8.32689537 100.88174,15.2388435 C97.8157022,29.5668288 94.0284052,43.7312658 89.5342738,57.6782049 L48.4343057,32.3804748 C48.4343057,32.3804748 73.6201447,6.52978886 79.0171102,2.52085895 C81.9461562,0.0899965767 85.9303942,-0.643174192 89.5342738,0.585513479 L89.5342738,0.585513479 Z"></path>
</g>
<polygon fill="#BFBEBA" fill-rule="nonzero"
points="351.731 188.715 524.683 188.65 524.678 200.692 351.726 200.757"
transform="rotate(22.9 438.204 194.704)"></polygon>
<polygon fill="#BFBEBA" fill-rule="nonzero"
points="400.402 312.102 586.898 312.149 586.902 328.477 400.406 328.43"
transform="rotate(104.4 493.652 320.29)"></polygon>
<ellipse cx="516.376" cy="230.602" fill="#E5DBDA" fill-rule="nonzero" rx="11.624"
ry="11.612"></ellipse>
<path fill="#BFBEBA" fill-rule="nonzero"
d="M391.968793,463.396323 L508.764661,463.396323 C512.968159,463.396323 516.375767,466.800366 516.375767,470.999466 L516.375767,482.611539 L384.219304,482.611539 L384.219304,470.999466 C384.219304,468.958805 385.039816,467.003668 386.497246,465.573761 C387.954677,464.143853 389.926333,463.35922 391.968793,463.396323 Z"></path>
<polygon fill="#BFBEBA" fill-rule="nonzero"
points="453.273 466.714 461.299 419.022 476.521 419.022 483.164 466.714"></polygon>
<ellipse cx="469.879" cy="414.321" fill="#E5DBDA" fill-rule="nonzero" rx="16.606"
ry="16.589"></ellipse>
</g>
</svg>
</svg>
First a small example. The red rectangle behaves like you lamp -- the scaling happens from 0,0 (top left corner). The "right" solution is the green. You can see that I move 0,0 to the middle of the rectangle by setting x and y to negative values. This is just one shape -- you have multiple. So, the blue rectangle is nested in more groups and the hover/scale happens on the one group that does not have a transform already (important). So instead of changing all the x,y values for all the shapes (here just the one blue rectangle) you can group and translate that group in the negative direction making 0,0 the middle of the group.
Now, go and see my edits of your drawing. I added two groups. The one scales the group and the other places 0,0 in the middle. The values are half the width and height of the entire group. If you are using an editor you can select the group/elements and see the width and height, or like I did open the dev tools in the browser and use the function getBBox() on the element/group (it returns width = 101.09695434570312 and height = 118.64158630371094 ~ 50,60). I also had to add the reverse values to the original group, so that the lamp is in place.
PS I also moved the polygon that draws the arm up above the lamp group so that is stays behind the lamp when it scales.
.hover:hover {
scale: 1.2;
}
<svg viewBox="0 0 100 100" width="200">
<rect class="hover" width="20" height="20" x="0" y="10" fill="red" />
<g transform="translate(40 20)">
<rect class="hover" width="20" height="20" x="-10" y="-10" fill="green" />
</g>
<g transform="translate(70 20)">
<g class="hover">
<g transform="translate(-10 -10)">
<rect width="20" height="20" x="0" y="0" fill="blue" />
</g>
</g>
</g>
</svg>
.interactive:hover > g {
scale: 1.2;
}
<svg viewBox="0 0 1920 1080" version="1.1" xmlns="http://www.w3.org/2000/svg">
<svg>
<g fill="none" fill-rule="evenodd" transform="translate(0 .832)">
<path fill="#FCFC30" fill-opacity=".35"
d="M283.589311,155.632129 L373.36705,522.838236 C377.564302,540.005704 367.049864,557.325232 349.882396,561.522484 C347.399779,562.129455 344.853386,562.436827 342.297648,562.438029 L162.3966,562.522631 C144.72349,562.530942 130.389866,548.210793 130.381555,530.537683 C130.380345,527.962942 130.689882,525.397465 131.303454,522.896901 L221.426762,155.606192 C225.638338,138.442233 242.966634,127.942251 260.130594,132.153828 C271.714734,134.996266 280.756541,144.04562 283.589311,155.632129 Z"
transform="rotate(32 252.31 295.631)"></path>
<polygon fill="#BFBEBA" fill-rule="nonzero"
points="351.731 188.715 524.683 188.65 524.678 200.692 351.726 200.757"
transform="rotate(22.9 438.204 194.704)"></polygon>
/* This following group is the one to be made interactive */
<g fill-rule="nonzero" transform="translate(264.313 121.836) translate(50 60)" class="interactive" cursor="pointer">
<g>
<g transform="translate(-50 -60)">
<ellipse fill="#EFCF6A" rx="17.298" ry="17.28" cx="41.1" cy="90.717"></ellipse>
<path fill="#E5DBDA"
d="M0,68.8755609 C0,68.8755609 23.9403854,39.015945 48.4343057,32.3804748 L89.5342738,57.6782049 C89.5342738,57.6782049 95.6231579,89.4731662 76.9413543,118.641587 L0,68.8755609 Z"></path>
<path fill="#E5DBDA"
d="M89.5342738,0.585513479 L97.5605301,5.2856382 C97.5605301,5.2856382 102.127193,8.32689537 100.88174,15.2388435 C97.8157022,29.5668288 94.0284052,43.7312658 89.5342738,57.6782049 L48.4343057,32.3804748 C48.4343057,32.3804748 73.6201447,6.52978886 79.0171102,2.52085895 C81.9461562,0.0899965767 85.9303942,-0.643174192 89.5342738,0.585513479 L89.5342738,0.585513479 Z"></path>
</g>
</g>
</g>
<polygon fill="#BFBEBA" fill-rule="nonzero"
points="400.402 312.102 586.898 312.149 586.902 328.477 400.406 328.43"
transform="rotate(104.4 493.652 320.29)"></polygon>
<ellipse cx="516.376" cy="230.602" fill="#E5DBDA" fill-rule="nonzero" rx="11.624"
ry="11.612"></ellipse>
<path fill="#BFBEBA" fill-rule="nonzero"
d="M391.968793,463.396323 L508.764661,463.396323 C512.968159,463.396323 516.375767,466.800366 516.375767,470.999466 L516.375767,482.611539 L384.219304,482.611539 L384.219304,470.999466 C384.219304,468.958805 385.039816,467.003668 386.497246,465.573761 C387.954677,464.143853 389.926333,463.35922 391.968793,463.396323 Z"></path>
<polygon fill="#BFBEBA" fill-rule="nonzero"
points="453.273 466.714 461.299 419.022 476.521 419.022 483.164 466.714"></polygon>
<ellipse cx="469.879" cy="414.321" fill="#E5DBDA" fill-rule="nonzero" rx="16.606"
ry="16.589"></ellipse>
</g>
</svg>
</svg>
My code is
<svg
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" width="280px" viewBox="0 0 500 500" enable-background="new 0 0 500 500" xml:space="preserve">
<path
fill="transparent"
stroke="#424A52"
stroke-width="1"
stroke-dasharray="1000"
d="M184.127,70.885c0,0-0.495,1.486-1.75,1.486h-5.501h-6.361c-7.482,0.115-15.246,0-15.246,0h-19.685h-0.29
c-5.167,0-9.35-4.188-9.35-9.35c0-0.24,0.004-0.473,0.021-0.709V28.389v-0.245c0-5.167,4.185-9.351,9.352-9.351h19.109h9.717
l4.35,0.004V2.442c0-0.723-0.178-2.442,1.58-2.442h5.818h6.658c1.75,0,1.572,1.72,1.572,2.442L184.127,70.885z M164.144,32.04
l-9.717-0.012c-3.534-0.009-6.987-0.004-8.312,0.012c-3.113,0.027-4.432,1.942-4.432,3.826V55.89c0,1.883,1.318,3.802,4.432,3.825
c3.113,0.027,9.153,0,9.153,0h9.952c2.596,0,3.268-0.602,3.268-2.487V32.04H164.144z M120.82,70.885c0,0-0.496,1.486-1.751,1.486
h-5.496h-6.366c-7.477,0.115-15.242,0-15.242,0H72.276h-0.287c-5.165,0-9.354-4.188-9.354-9.35c0-0.24,0.013-0.473,0.028-0.709
V28.389l-0.006-0.245c0-5.167,4.19-9.351,9.354-9.351H91.12h9.716h4.35l0.008-16.351c0-0.723-0.186-2.442,1.569-2.442h5.826h6.651
c1.758,0,1.574,1.72,1.574,2.442L120.82,70.885z M100.837,32.04l-9.716-0.012c-3.536-0.009-6.988-0.004-8.311,0.012
c-3.116,0.027-4.428,1.942-4.428,3.826V55.89c0,1.883,1.312,3.802,4.428,3.825c3.11,0.027,9.154,0,9.154,0h9.947
c2.603,0,3.268-0.602,3.268-2.487l0.007-25.188H100.837z M41.873,39.316v-3.304l0.013-0.256c0-1.881-1.376-3.433-3.172-3.729
c-0.189-0.031-0.385-0.052-0.599-0.052H3.391c0,0-1.428-0.111-1.428-1.431V19.732c0,0,0.059-0.975,1.262-0.975h0.166H48.17
c5.042,0.059,9.054,3.958,9.279,8.848c0.033,0.379,0.059,0.769,0.059,1.178v41.902c0,0,0.224,1.735-1.407,1.735H9.262l-0.178-0.026
c-3.305-0.071-6.177-1.865-7.76-4.524C0.524,66.646,0,65.094,0,63.135c0-8.196,0.028-14.571,0.028-14.571
c0-5.114,4.146-9.258,9.257-9.258l0.448,0.011L41.873,39.316L41.873,39.316z M12.519,52.915v4.377c0,1.526,1.238,2.764,2.764,2.764
H41.96v-9.9H15.282C13.757,50.154,12.519,51.391,12.519,52.915z M238.49,18.847c4.27,0.044,7.776,2.801,8.943,6.583
c0.264,0.839,0.419,1.751,0.419,2.758v17.447V63.03c0,4.961-3.825,9.006-8.678,9.352c-0.23,0.027-0.448,0.039-0.647,0.039h-19.976
h-19.967c-4.396-0.008-8.056-3.025-9.065-7.098c-0.171-0.701-0.271-1.449-0.271-2.258v-17.43V28.218v-0.151
c0.024-0.847,0.124-1.529,0.289-2.169c0.977-3.841,4.341-6.727,8.409-7.012c0.229-0.026,0.449-0.039,0.656-0.039h19.948H238.49z
M228.722,31.97h-10.17h-10.178c-0.1,0-0.211,0.007-0.332,0.021c-2.078,0.144-3.785,1.622-4.288,3.579
c-0.086,0.324-0.138,0.676-0.147,1.186v8.88v8.893c0,0.408,0.05,0.795,0.136,1.146c0.517,2.078,2.385,3.623,4.628,3.623h10.182
h10.186c0.108,0,0.216-0.004,0.332-0.021c2.474-0.175,4.425-2.237,4.425-4.771v-8.869v-8.896c0-0.52-0.074-0.986-0.214-1.407
C232.688,33.404,230.899,31.997,228.722,31.97z M284.508,42.245c-1.627,1.908-3.631,2.168-4.997,2.168
c-2.052,0-3.748-0.637-5.115-2.264c-1.179-1.367-2.099-3.561-2.099-6.507c0-4.597,2.264-8.723,7.214-8.723
c5.517,0,7.144,4.856,7.12,8.628C286.606,38.094,285.853,40.665,284.508,42.245z M279.51,28.288c-4.242,0-5.539,4.196-5.539,7.379
c0,3.087,1.226,7.332,5.47,7.332c5.14,0,5.492-6.082,5.492-7.425C284.958,32.555,283.73,28.288,279.51,28.288z M291.252,43.988
h-1.533V27.344h10.892v1.391h-9.358v5.634h8.394v1.368h-8.394V43.988L291.252,43.988z M304.5,43.988h-1.533V27.344h10.893v1.391
h-9.357v5.634h8.393v1.368h-8.393v8.251H304.5z M317.797,43.988h-1.58V27.344h1.58V43.988z M334.323,40.357
c-1.603,3.536-4.102,4.056-6.177,4.056c-1.155,0-3.583-0.164-5.327-2.217c-1.25-1.461-1.934-3.818-1.934-6.412
c0-3.536,1.273-8.864,7.119-8.864c4.479,0,5.705,2.711,6.437,4.314l-1.58,0.825c-0.306-1.368-1.084-2.381-1.769-2.9
c-1.107-0.825-2.428-0.849-3.018-0.849c-1.791,0-3.041,0.519-4.103,1.957c-1.154,1.58-1.438,3.489-1.438,5.281
c0,1.132,0.166,3.843,1.391,5.494c1.32,1.769,3.229,1.957,4.408,1.957c0.803,0,1.746-0.095,2.617-0.707
c0.59-0.401,1.51-1.367,1.909-2.83L334.323,40.357z M348.799,43.988H337.34V27.344h10.869v1.462h-9.289v5.917h8.416v1.462h-8.416
v6.341h9.879V43.988z M359.502,43.988h-1.533V27.344h10.892v1.391h-9.358v5.634h8.394v1.368h-8.394V43.988L359.502,43.988z
M372.75,27.344v9.903c0,1.814,0.023,3.088,0.801,4.125c0.566,0.754,1.793,1.58,3.867,1.58c0.59,0,1.392-0.048,2.168-0.354
c1.273-0.495,1.935-1.298,2.287-2.759c0.143-0.565,0.166-1.557,0.166-2.17V27.344h1.578v7.568c0,4.62,0,6.2-1.414,7.732
c-1.201,1.297-2.994,1.769-4.738,1.769c-2.805,0-5.115-1.203-5.894-3.606c-0.401-1.202-0.378-2.122-0.378-5.752v-7.709
L372.75,27.344L372.75,27.344z M400.168,43.988h-1.979l-5.259-7.379h-3.913v7.379h-1.58V27.321h4.668c2.9,0,3.631,0.023,4.668,0.377
c2.734,0.966,2.924,3.583,2.924,4.408c0,1.745-0.754,2.711-1.25,3.206c-1.201,1.132-2.781,1.226-3.678,1.297L400.168,43.988z
M389.018,35.242h3.913c1.085,0,2.099-0.024,2.806-0.165c1.768-0.354,2.404-1.698,2.404-3.042c0-1.626-0.803-2.853-2.428-3.183
c-0.473-0.094-0.685-0.118-2.782-0.118h-3.913V35.242L389.018,35.242z M415.54,43.988h-1.555l-9.783-14.381v14.381h-1.533V27.344
h1.533l9.924,14.241l-0.141-14.241h1.555V43.988z M420.94,43.988h-1.58V27.344h1.58V43.988z M430.016,43.988h-1.58V28.735h-5.232
v-1.391h12.07v1.391h-5.258V43.988L430.016,43.988z M439.069,27.344v9.903c0,1.814,0.021,3.088,0.801,4.125
c0.564,0.754,1.791,1.58,3.865,1.58c0.59,0,1.393-0.048,2.17-0.354c1.271-0.495,1.934-1.298,2.287-2.759
c0.141-0.565,0.164-1.557,0.164-2.17V27.344h1.578v7.568c0,4.62,0,6.2-1.412,7.732c-1.203,1.297-2.994,1.769-4.738,1.769
c-2.807,0-5.117-1.203-5.896-3.606c-0.398-1.202-0.377-2.122-0.377-5.752v-7.709L439.069,27.344L439.069,27.344z M466.485,43.988
h-1.979l-5.258-7.379h-3.914v7.379h-1.58V27.321h4.668c2.9,0,3.631,0.023,4.668,0.377c2.734,0.966,2.924,3.583,2.924,4.408
c0,1.745-0.754,2.711-1.25,3.206c-1.201,1.132-2.781,1.226-3.678,1.297L466.485,43.988z M455.334,35.242h3.914
c1.084,0,2.098-0.024,2.805-0.165c1.77-0.354,2.404-1.698,2.404-3.042c0-1.626-0.801-2.853-2.428-3.183
c-0.473-0.094-0.684-0.118-2.781-0.118h-3.914V35.242L455.334,35.242z M480.442,43.988h-11.457V27.344h10.867v1.462h-9.287v5.917
h8.416v1.462h-8.416v6.341h9.877V43.988L480.442,43.988z M285.734,68.648c-1.603,3.536-4.103,4.056-6.177,4.056
c-1.155,0-3.583-0.164-5.327-2.217c-1.25-1.461-1.935-3.818-1.935-6.412c0-3.535,1.273-8.863,7.119-8.863
c4.479,0,5.707,2.711,6.438,4.313l-1.58,0.825c-0.307-1.367-1.084-2.381-1.768-2.898c-1.108-0.826-2.43-0.851-3.019-0.851
c-1.792,0-3.041,0.521-4.103,1.957c-1.154,1.58-1.438,3.489-1.438,5.28c0,1.131,0.165,3.844,1.392,5.492
c1.32,1.77,3.229,1.957,4.408,1.957c0.801,0,1.744-0.094,2.616-0.707c0.591-0.4,1.509-1.367,1.909-2.828L285.734,68.648z
M300.233,70.536c-1.627,1.908-3.631,2.168-4.998,2.168c-2.051,0-3.748-0.637-5.115-2.264c-1.179-1.367-2.099-3.561-2.099-6.507
c0-4.597,2.265-8.724,7.214-8.724c5.518,0,7.145,4.856,7.12,8.629C302.331,66.385,301.577,68.956,300.233,70.536z M295.235,56.579
c-4.242,0-5.54,4.195-5.54,7.379c0,3.088,1.226,7.332,5.47,7.332c5.14,0,5.492-6.082,5.492-7.427
C300.682,60.846,299.456,56.579,295.235,56.579z M318.315,72.279h-1.557l-9.782-14.381v14.381h-1.533V55.635h1.533l9.925,14.24
l-0.143-14.24h1.557V72.279z M327.393,72.279h-1.58V57.026h-5.232v-1.391h12.069v1.391h-5.257V72.279L327.393,72.279z
M347.643,72.279h-1.979l-5.258-7.379h-3.914v7.379h-1.58V55.612h4.668c2.9,0,3.631,0.023,4.668,0.377
c2.734,0.967,2.924,3.584,2.924,4.408c0,1.745-0.754,2.711-1.25,3.206c-1.201,1.132-2.781,1.228-3.678,1.297L347.643,72.279z
M336.493,63.534h3.912c1.086,0,2.1-0.023,2.807-0.166c1.768-0.354,2.404-1.697,2.404-3.041c0-1.627-0.803-2.853-2.429-3.183
c-0.472-0.095-0.685-0.118-2.782-0.118h-3.912V63.534L336.493,63.534z M363.204,72.279h-1.722l-1.909-5.021h-7.449l-1.887,5.021
h-1.77l6.791-16.644h1.32L363.204,72.279z M359.102,65.984l-3.206-8.485l-3.254,8.485H359.102z M378.079,68.648
c-1.603,3.536-4.102,4.056-6.177,4.056c-1.155,0-3.583-0.164-5.327-2.217c-1.25-1.461-1.934-3.818-1.934-6.412
c0-3.535,1.273-8.863,7.12-8.863c4.479,0,5.704,2.711,6.437,4.313l-1.58,0.825c-0.307-1.367-1.084-2.381-1.769-2.898
c-1.108-0.826-2.429-0.851-3.019-0.851c-1.791,0-3.041,0.521-4.103,1.957c-1.153,1.58-1.438,3.489-1.438,5.28
c0,1.131,0.166,3.844,1.392,5.492c1.319,1.77,3.229,1.957,4.407,1.957c0.803,0,1.746-0.094,2.617-0.707
c0.59-0.4,1.51-1.367,1.91-2.828L378.079,68.648z M386.354,72.279h-1.58V57.026h-5.232v-1.391h12.069v1.391h-5.257V72.279
L386.354,72.279z">
<animate
attributeName="fill"
from="transparent"
to="#424A52"
dur="1s"
begin="2s"
fill="freeze" />
<animate
attributeName="stroke-dashoffset"
from="1000"
to="0"
dur="6s"
fill="freeze" />
</path>
</svg>
This results in this warning message in Chrome:
SVG's SMIL animations (, , etc.) are deprecated and will be removed. Please use CSS animations or Web animations instead.
What's the problem in my code?
There's no problem with your code other than Chrome has removed native SMIL support.
Fortunately they also provided a SMIL shim. Drop that in to your page and you get SMIL back again.
IE doesn't support SMIL either but the fakesmile shim can remedy that.
I have an svg defining a path drawn on a transparent background -- a pretty basic svg.
I need to convert this svg so that the background is white and the text is transparent and cutout of the white background. I have been playing around with clip-path but to no avail. How is the right way to make this modification?
<svg width="138" xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 0 138 40">
<g transform="translate(2 30)">
<path d="m6.12,0 5.88,0 0-2.46-.6,0-2.535-9.21-5.46,0-2.535,9.21-.6,0 0,2.46 5.13,0 0-2.46-.9,0 .24-1.2 2.025,0 .255,1.2-.9,0 0,2.46m-.435-8.235 .15,0 .615,2.985-1.38,0 .615-2.985"/>
<path d="m12.3696-9.21 .66,0 0,6.75-.66,0 0,2.46 4.77,0 0-2.46-.66,0 0-9.21-4.11,0 0,2.46"/>
<path d="m17.5552-5.88 .66,0 0,3.42-.66,0 0,2.46 5.28,0 0-2.46-1.17,0 0-3.42 1.17,0 0-2.46-1.17,0c0-.63 .255-.87 1.035-.87 .735,0 1.47,.075 1.47,.075v-2.355c0,0-.78-.39-2.43-.39-2.205,0-3.495,1.035-3.495,3.54h-.69v2.46"/>
<path d="m28.518,0 4.11,0 0-2.46-.66,0 0-2.46c0-2.415-.945-3.63-4.155-3.63-2.385,0-4.155,.525-4.155,.525v2.58c.99-.225 2.295-.435 3.48-.435 1.125,0 1.38,.3 1.38,.87-3.735,0-5.4,1.02-5.4,2.88 0,1.515 1.065,2.34 2.775,2.34 1.44,0 2.25-.75 2.625-1.23v1.02m0-3.42c0,.645-.33,.96-.915,.96-.57,0-.825-.135-.825-.48 0-.48 .675-.57 1.74-.57v.09"/>
<path d="m41.9899-2.685c-.75,0-.93-.285-.93-.885h-3.3v2.97c0,0 1.815,.81 4.695,.81 3.21,0 4.95-1.29 4.95-3.855 0-2.58-1.935-3.375-4.26-4.125-.615-.195-.93-.3-.93-.645 0-.42 .27-.57 .93-.57 .465,0 .825,.18 .825,.75h3.15v-2.685c0,0-1.485-.96-4.38-.96-3.84,0-5.115,1.38-5.115,3.615 0,2.34 1.44,3.135 4.41,4.245 .705,.255 .87,.465 .87,.735 0,.39-.255,.6-.915,.6"/>
<path d="m47.8481-9.21 .66,0 0,6.75-.66,0 0,2.46 4.77,0 0-2.46-.66,0 0-9.21-4.11,0 0,2.46"/>
<path d="m58.2837,0 4.11,0 0-2.46-.66,0 0-2.46c0-2.415-.945-3.63-4.155-3.63-2.385,0-4.155,.525-4.155,.525v2.58c.99-.225 2.295-.435 3.48-.435 1.125,0 1.38,.3 1.38,.87-3.735,0-5.4,1.02-5.4,2.88 0,1.515 1.065,2.34 2.775,2.34 1.44,0 2.25-.75 2.625-1.23v1.02m0-3.42c0,.645-.33,.96-.915,.96-.57,0-.825-.135-.825-.48 0-.48 .675-.57 1.74-.57v.09"/>
<path d="m66.9288-11.67-4.11,0 0,2.46 .66,0 0,6.75-.66,0 0,2.46 4.11,0 0-1.02c.375,.48 1.185,1.23 2.325,1.23 2.07,0 3.075-1.62 3.075-4.38 0-2.76-1.005-4.38-3.075-4.38-1.14,0-1.95,.75-2.325,1.23v-4.35m1.74,8.25c0,.675-.3,.96-.87,.96-.57,0-.87-.285-.87-.96v-1.5c0-.675 .3-.96 .87-.96 .57,0 .87,.285 .87,.96v1.5"/>
<path d="m83.0515-2.46c-.675,0-1.02-.33-1.02-1.11v-4.53c0-.78 .345-1.11 1.02-1.11 .675,0 1.02,.33 1.02,1.11v4.53c0,.78-.345,1.11-1.02,1.11m5.73-3.375c0-4.38-2.235-6.045-5.73-6.045-3.495,0-5.73,1.665-5.73,6.045 0,4.38 2.235,6.045 5.73,6.045 3.495,0 5.73-1.665 5.73-6.045"/>
<path d="m94.4339,0 4.77,0 0-2.46-.66,0 0-2.46c0-2.505-1.02-3.63-2.655-3.63-1.35,0-2.055,.75-2.535,1.23v-1.02h-4.11v2.46h.66v3.42h-.66v2.46h4.77v-2.46h-.66v-2.46c0-.675 .3-.96 .87-.96 .57,0 .87,.285 .87,.96v2.46h-.66v2.46"/>
<path d="m103.732-8.55c-2.775,0-4.53,1.455-4.53,4.38 0,2.925 1.755,4.38 4.53,4.38 2.385,0 3.735-.75 3.735-.75v-2.4c-.72,.24-1.86,.48-3.18,.48-1.05,0-1.425-.36-1.425-1.08v-.09h4.86v-1.08c0-1.89-.915-3.84-3.99-3.84m0,2.67c.57,0 .87,.285 .87,.96v.09h-1.74v-.09c0-.675 .3-.96 .87-.96"/>
</g>
</svg>
Try using a mask instead of a clip path.
<mask id="m"> ... </mask>
Inside the mask, create a white rectangle, followed by (under) your black paths. The brightness of different areas of the mask determines the opacity of the corresponding areas of the element the mask is applied to, with white areas being fully opaque and black areas being fully transparent.
<rect width="100%" height="100%" fill="white" />
<g transform="translate(2 30)"> ... </g>
After the mask, add another rectangle and set its mask attribute to your mask. This rectangle is the white background you wanted, so give it a white fill.
<rect width="100%" height="100%" fill="white" mask="url(#m)" />
This should give you the effect you want. Check out this fiddle: http://jsfiddle.net/9tT6T/