gpt4 book ai didi

svg - SVG多边形中的逗号与空格

转载 作者:行者123 更新时间:2023-12-05 03:11:21 45 4
gpt4 key购买 nike

我注意到 Adob​​e illustrator 会输出像这样的 SVG

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 521.92 138"><defs><style>.a{fill:#0e0e0e;}.b{fill:#535353;}</style></defs><title>macys_john</title>

<path class="a" d="M319.2,48.7a42.9,42.9,0,1,0,0,31.6v24.4h3.1V23.6h-3.1V48.7Zm-11.7,44a39.83,39.83,0,1,1,11.7-28.2A40.26,40.26,0,0,1,307.5,92.7Z"/>

<path class="a" d="M200.2,21.5c-12.2,0-20.3,5.6-25.1,12.3a37.57,37.57,0,0,0-4.7,9.1,29.89,29.89,0,0,0-5.2-10.4c-4.7-6.2-12.7-11-24.8-11s-20.3,5.6-25.1,12.3a40.48,40.48,0,0,0-3.6,6.3V23.6h-3.1v81.2h3.1V53.4a33.76,33.76,0,0,1,6.1-17.8c4.4-6.1,11.4-11,22.6-11s18.1,4.4,22.3,9.8a28.9,28.9,0,0,1,5.7,16.8v53.9h3.1V52.3a33.39,33.39,0,0,1,6-16.6c4.4-6.1,11.4-11,22.6-11s18.1,4.4,22.3,9.8a28.9,28.9,0,0,1,5.7,16.8v53.9h3.1V51.3a31.4,31.4,0,0,0-6.4-18.7C220.3,26.3,212.3,21.4,200.2,21.5Z"/>

<polygon class="a" points="476.4 23.4 473 23.4 439.7 100.6 408.3 23.4 405 23.4 438 104.6 423.6 138 427 138 476.4 23.4"/>

<path class="a" d="M518.6,70.6c-3.3-4.5-9.3-7.8-20.3-10.7-9.1-2.4-13.6-6.1-16-9.4a12,12,0,0,1-2.6-7.1V43h0V41.9a19.9,19.9,0,0,1,2.7-10.1c2.4-3.8,6.7-7.2,15.6-7.3,9.4,0,13.8,3.6,16.3,7.5a18.22,18.22,0,0,1,2.6,9.5v0.3L520,42V41.5a21.87,21.87,0,0,0-3.1-11.1c-2.9-4.7-8.7-9-18.9-9-9.7,0-15.4,4.1-18.3,8.7a22.79,22.79,0,0,0-3.2,11.8v1.4a15.17,15.17,0,0,0,3.2,9c2.8,3.9,8.1,8,17.7,10.5,10.8,2.9,16.1,6,18.6,9.6s2.9,7.9,2.8,14a17,17,0,0,1-6,12.5,22.32,22.32,0,0,1-15,5.6,23,23,0,0,1-14.3-5.1c-4.1-3.4-6.9-8.6-6.9-16h-3.1c0,8.2,3.3,14.4,8.1,18.4a25.27,25.27,0,0,0,16.3,5.8c13.4,0,24-9.9,24-21.1C522,80.4,521.9,75.2,518.6,70.6Z"/>

<polygon class="b" points="56.6 52.5 45.8 19.3 35 52.5 0 52.5 28.3 73.1 17.5 106.3 45.8 85.8 74 106.3 63.2 73.1 91.5 52.5 56.6 52.5"/>

<polygon class="a" points="475.4 16.1 480.6 12.3 485.9 16.1 483.9 10 489.1 6.2 482.6 6.2 480.6 0 478.6 6.2 472.2 6.2 477.4 10 475.4 16.1"/>

<path class="a" d="M368.7,24.7a39.84,39.84,0,0,1,28.2,11.7,38.91,38.91,0,0,1,8.6,12.9h3.3a42.93,42.93,0,1,0-.1,30.8h-3.3A39.9,39.9,0,1,1,368.7,24.7Z"/></svg>

但我看不到 w3c 规范中的某些坐标点如何用空格而不是逗号来表示。我的问题具体是

  1. 它在规范中的什么地方声称这是正确的?
  2. 在与查看器/浏览器等的兼容性方面,空格和逗号之间是否有区别...

最佳答案

折线/多边形点属性的语法是here

路径 d 属性的语法是 here

在任何一种情况下,他们基本上都说最多允许一个逗号,前提是在逗号的左侧和右侧都有一个数字,因此 31, 3 是有效的,但 M, 5, 7 不是。

Firefox 严格遵守规范,其他一些 UA 可能更宽松地允许多余的无效逗号,但所有 UA 都支持有效的逗号。

关于svg - SVG多边形中的逗号与空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37218495/

45 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com