KonghaYao / cn-font-split

划时代的字体切割工具,CJK与任何字符!支持 otf、ttf、woff2 字体多线程切割,完美地细颗粒度地进行包大小控制。A revolutionary font subetter that supports CJK and any characters! It enables multi-threaded subset of otf, ttf, and woff2 fonts, allowing for precise control over package size.
https://chinese-font.netlify.app/
Apache License 2.0
503 stars 16 forks source link

feat: 添加 CSS font-family #8

Closed KonghaYao closed 1 year ago

KonghaYao commented 1 year ago

CSS 文件中完整的 src 属性应该包含 format 函数(参考自 Learn Responsive Design - Typography)。

@font-face {
    font-family: "霞鹜文楷";
    font-weight: 400;
    src: local("LXGW WenKai"),
         url("./lxgwwenkai-regular-400.woff2") format("woff2"),
         url("./lxgwwenkai-regular-400.woff") format("woff"),
         url("./lxgwwenkai-regular-400.ttf") format("turetype"),
         url("./lxgwwenkai-regular-400.otf") format("opentype");
}
KonghaYao commented 1 year ago

优化方案: image

KonghaYao commented 1 year ago

4.6.0 版本更新完成