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
496 stars 16 forks source link

[分包算法]:单包 feature 巨量问题 #42

Open KonghaYao opened 9 months ago

KonghaYao commented 9 months ago
/* ❌ 这个特性不生效 */
@font-face {
    font-family: 'test';
    src: url('./fi.ttf');
    unicode-range: U+66, U+69;
}
/* ✅ 这个特性可以生效*/
@font-face {
    font-family: 'test';
    src: url('./fh.ttf');
    unicode-range: U+66, U+68;
}
body > * {
    font-size: 8rem;
    font-family: 'test';
}

浏览器默认规则,后面的生效,当 unicode overlap 时,采用后面的 U+66,从而导致前面的 feature 失效