Skip to content

Commit

Permalink
chore: 5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
KonghaYao committed Jul 16, 2024
1 parent 6a8252d commit 6e451c3
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 中文 Web Font 切割工具
# 中文 Web Font 切割工具 5.0

![中文网字计划](/assets/chinese-fonts.png)

![updateTime](https://img.shields.io/badge/更新时间-2024/06/13-green)
![updateTime](https://img.shields.io/badge/更新时间-2024/07/16-green)
![author](https://img.shields.io/badge/author-江夏尧-green)
![npmVersion](https://img.shields.io/badge/LTS_version-4.15.1-green)
![npmVersion](https://img.shields.io/badge/LTS_version-5.1.0-green)
[![](https://data.jsdelivr.com/v1/package/npm/cn-font-split/badge)](https://www.jsdelivr.com/package/npm/cn-font-split)

![NPM License](https://img.shields.io/npm/l/%40konghayao%2Fcn-font-split)
Expand Down Expand Up @@ -41,7 +41,7 @@
5. ✅ 📦 更加可控的分包方式,支持细颗粒度的字符拆分。
6. ✅ 🔔 支持 OTF 格式字体打包,支持复杂字形渲染。
7. ✅ 🏞️ 字体预览图生成
8. ✅ ⌨️ 支持 Nodejs、Deno、Bun、Browser,随处可使用
8. ✅ ⌨️ 支持 Nodejs、Deno、Bun、Browser,跨平台随处可使用、构建产物一致
9. ✅ 🥳 不止中文,只要是包内的字符,统统分包
10. ✅ 🏞️ 支持自动识别可变字体字重

Expand Down
5 changes: 1 addition & 4 deletions packages/subsets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,10 @@
5. ✅ 📦 更加可控的分包方式,支持细颗粒度的字符拆分。
6. ✅ 🔔 支持 OTF 格式字体打包,支持复杂字形渲染。
7. ✅ 🏞️ 字体预览图生成
8. ✅ ⌨️ 支持 Nodejs、Deno、Bun、Browser,随处可使用
8. ✅ ⌨️ 支持 Nodejs、Deno、Bun、Browser,跨平台随处可使用、构建产物一致
9. ✅ 🥳 不止中文,只要是包内的字符,统统分包
10. ✅ 🏞️ 支持自动识别可变字体字重

> 5.1.0 版本重新回归 `@chinese-fonts/wawoff2` 构建,保证了跨平台构建产物一致性。
> 但是构建速度将会略慢于 `@napi-rs/woff-build` 构建器,如果希望极速,可以在入参中 添加 buildMode: "speed"!
## 快速使用

Nodejs 版本推荐使用 **大于 18 的版本**。如低级版本或者其他的设备环境,[参考兼容性章节](#兼容性提醒)
Expand Down
4 changes: 2 additions & 2 deletions packages/subsets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
<script type="module">
import { fontSplit, Assets } from './dist/browser/index.js';
Assets.pathTransform = (innerPath) =>
innerPath.replace('./', 'http://127.0.0.1:5500/dist/browser/');
innerPath.replace('./', 'http://127.0.0.1:5500/packages/subsets/dist/browser/');

console.log(Assets);
const files = [];
await fontSplit({
destFold: '',
FontPath:
'https://cdn.jsdelivr.net/gh/KonghaYao/chinese-free-web-font-storage/packages/dyh/fonts/SmileySans-Oblique.ttf',
// FontPath: '../../test/temp/也字工厂小石头.ttf',
FontPath: '../../test/temp/也字工厂小石头.ttf',
// subsets: JSON.parse(await fs.readFile("./subsets/misans.json", "utf-8")),
previewImage: {},
outputFile(name, data) {
Expand Down
2 changes: 1 addition & 1 deletion packages/subsets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cn-font-split",
"version": "5.0.1",
"version": "5.1.0",
"description": "划时代的字体切割工具,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.",
"main": "dist/index.js",
"browser": "dist/browser/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/subsets/test/bun.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fs.emptyDirSync('./temp/bun');
fontSplit({
destFold: './temp/bun',
FontPath: '../demo/public/SmileySans-Oblique.ttf',
FontPath: './test/temp/也字工厂小石头.ttf',
// FontPath: './test/temp/也字工厂小石头.ttf',
// FontPath: './test/temp/江西拙楷.ttf',
// FontPath: './test/temp/MaokenAssortedSans1.30.ttf',
// FontPath: './test/temp/字魂扁桃体.ttf',
Expand Down
2 changes: 1 addition & 1 deletion packages/subsets/test/deno.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ console.log(Assets);
fontSplit({
destFold: './temp/deno',
FontPath: '../demo/public/SmileySans-Oblique.ttf',
FontPath: './test/temp/也字工厂小石头.ttf',
// FontPath: './test/temp/也字工厂小石头.ttf',
// subsets: JSON.parse(await fs.readFile("./subsets/misans.json", "utf-8")),
// previewImage: {},
});
2 changes: 1 addition & 1 deletion packages/subsets/test/node.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fs.emptyDirSync('./temp/node');
fontSplit({
destFold: './temp/node',
FontPath: '../demo/public/SmileySans-Oblique.ttf',
FontPath: './test/temp/也字工厂小石头.ttf',
// FontPath: './test/temp/也字工厂小石头.ttf',
// FontPath: './test/temp/AlibabaPuHuiTi-3-85-Bold.otf',
// FontPath: './test/temp/字魂扁桃体.ttf',
// FontPath: './test/temp/京華老宋体v1.007.ttf',
Expand Down

0 comments on commit 6e451c3

Please sign in to comment.