-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
88 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import fs from 'fs-extra'; | ||
import { fontSplit } from '../dist/index.js'; | ||
import crypto from 'node:crypto' | ||
|
||
fs.emptyDirSync('./temp/node'); | ||
fontSplit({ | ||
destFold: './temp/node', | ||
// FontPath: '../demo/public/SmileySans-Oblique.ttf', | ||
FontPath: './test/temp/Yozai-Light.ttf',// 不折行问题 | ||
FontPath: './test/temp/qiji-fallback.ttf',// 大小问题 | ||
FontPath: './test/temp/随峰体.ttf',// 大小问题 | ||
|
||
targetType: 'woff2', | ||
// subsets: JSON.parse(await fs.readFile("./subsets/misans.json", "utf-8")), | ||
previewImage: {}, | ||
chunkSize: 70 * 1024, | ||
css: { | ||
// fontWeight: false | ||
// localFamily: false, | ||
// comment: false, | ||
// comment: { | ||
// base: false, | ||
// nameTable: false, | ||
// unicodes: true | ||
// } | ||
} | ||
// autoChunk: false, | ||
// subsets: [[31105, 8413]], | ||
// threads: {}, | ||
// renameOutputFont: '[hash:10][ext]', | ||
// renameOutputFont: '[index][ext]', | ||
// renameOutputFont({ transferred, ext, index }) { | ||
// const algorithm = 'sha256' | ||
// const hash = crypto.createHash(algorithm).update(transferred).digest('hex') | ||
// // return index.toString() + ext // index 命名 | ||
// return hash.slice(0, 6) + ext // 短 hash 命名 | ||
// } | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters