为 ObjectBoundingBox 导出 SVG [英] Export SVG for ObjectBoundingBox

查看:26
本文介绍了为 ObjectBoundingBox 导出 SVG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 SVG 的经验很少,我正在尝试从 Illustrator 中保存路径,以便使用 clipPathUnits="objectBoundingBox"<将其用作大小与其父项相关的响应剪切蒙版.

I have very little experience with SVG and I'm trying to save a path from illustrator so that it can be used as a responsive clipping mask whose size is relative to its parent, using clipPathUnits="objectBoundingBox".

但是,Illustrator 似乎不允许我在 01 之间有相对路径值,只能导出绝对值.

However, Illustrator doesn't seem to allow me to have relative path values between 0 and 1 and only exports absolute values.

我怎么能得到这样的代码...

How could I get code like this...

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
 viewBox="0 0 100 100">
    <clippath id="clipping-mask">
        <path d="M49.401,64H36.3V30.648h11.201c3.9,0,7.15,0.25,10.501,2.4c4.95,3.15,7.1,8.45,7.1,14.151
    C65.102,56.75,59.352,64,49.401,64z M48.501,38.148h-3.7V56.5h3.65c5.7,0,8.15-3.65,8.15-9.051
    C56.602,42.148,54.252,38.148,48.501,38.148z"/>
    </clippath>
</svg>

...与其父对象相关?

... to be relative to its parent?

谢谢!

推荐答案

从 Paul LeBeau 的回答和 https 上的回答中得到提示://graphicdesign.stackexchange.com/a/42666 我发现您实际上可以将 Illustrator 中的画板设置为 1x1,并且在保存到 SVG 时增加保存时 SVG 选项中的小数位.这将导致小数点已调整的 SVG.

Taking a cue from Paul LeBeau's answer and from the answer at https://graphicdesign.stackexchange.com/a/42666 I figured out that you can actually set the art board in Illustrator to 1x1 and when saving to SVG increase the decimal places in the SVG Options on save. This will result in an SVG with the decimals already adjusted.

这篇关于为 ObjectBoundingBox 导出 SVG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆