gpt4 book ai didi

html - 使用 CSS 对字体进行圆 Angular 处理

转载 作者:行者123 更新时间:2023-12-04 04:11:06 25 4
gpt4 key购买 nike

是否可以使用 CSS 将字体转换为圆边?

我说的是与此类似的效果 smooth edges in Photoshop

enter image description here

到目前为止,我尝试使用 SVG 滤镜,但它似乎有点复杂。

有没有更好的办法?

使用的 SVG 过滤器的代码是这样的:

<svg viewbox="0 0 100% 100%">
<defs>
<filter id="smooth">
<feMorphology operator="dilate" radius="0" />
<feGaussianBlur stdDeviation="3" />
<feComponentTransfer>
<feFuncA type="table" tableValues="0 0 1 1"></feFuncA>
</feComponentTransfer>
<feComponentTransfer>
<feFuncA type="table" tableValues="0 0 1 1"></feFuncA>
</feComponentTransfer>
<feComponentTransfer out="rounded1">
<feFuncA type="table" tableValues="0 0 1 1"></feFuncA>
</feComponentTransfer>
<feComposite in2="rounded1" in="SourceGraphics" operator="in"/>
</filter>
</defs>
</svg>

解释在这里:https://dev.to/codingdudecom/css-smooth-font-edges-3pbb

最佳答案

一种可能的解决方案是像这样使用 goo 过滤器。作为观察,您需要知道对于不同的字体和不同的字体大小,您可能需要更改 feColorMatrixstdDeviation

的值

div {
height: 200px;
padding:10px 60px;
font-size:200px;
font-family:Arial;
filter:url(#goo);
}

svg{position:absolute;}
<svg width="0" height="0">
<defs>
<filter id="goo">
<feGaussianBlur in="SourceGraphic" stdDeviation="7" />
<feColorMatrix mode="matrix" values="1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 35 -7" />
<feBlend in="SourceGraphic" />
</filter>
</defs>
</svg>
<div>
<span>A B</span>
</div>

请阅读 The Goeey Effect

关于html - 使用 CSS 对字体进行圆 Angular 处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61710821/

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