Commit caa21c0 1 parent 9bdba02 commit caa21c0 Copy full SHA for caa21c0
File tree 2 files changed +22
-21
lines changed
2 files changed +22
-21
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " performance" ,
3
- "version" : " 1.0.0" ,
4
- "description" : " " ,
5
- "main" : " index.js" ,
6
- "scripts" : {
7
- "test" : " echo \" Error: no test specified\" && exit 1"
8
- },
9
- "keywords" : [],
10
- "author" : " " ,
11
- "license" : " ISC" ,
12
- "dependencies" : {
13
- "@japont/unicode-range" : " ^1.0.0" ,
14
- "cn-font-split" : " 7.2.2 " ,
15
- "byte-size" : " ^8.1.1" ,
16
- "solid-js" : " ^1.7.8"
17
- }
2
+ "name" : " performance" ,
3
+ "version" : " 1.0.0" ,
4
+ "description" : " " ,
5
+ "main" : " index.js" ,
6
+ "scripts" : {
7
+ "test" : " echo \" Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords" : [],
10
+ "author" : " " ,
11
+ "license" : " ISC" ,
12
+ "dependencies" : {
13
+ "@japont/unicode-range" : " ^1.0.0" ,
14
+ "cn-font-split" : " 7.2.4 " ,
15
+ "byte-size" : " ^8.1.1" ,
16
+ "solid-js" : " ^1.7.8"
17
+ }
18
18
}
Original file line number Diff line number Diff line change @@ -13,14 +13,15 @@ export async function main(build = false) {
13
13
const input = '../demo/public/NotoSerifSC-Regular.ttf' ;
14
14
const sample = generateNumbers ( 10 , 100 , 5 ) ;
15
15
// 生成字体
16
- build &&
17
- sample . forEach ( ( size ) => {
18
- fontSplit ( {
16
+ if ( build ) {
17
+ for ( let size of sample ) {
18
+ await fontSplit ( {
19
19
input,
20
20
outDir : './build/' + size ,
21
21
chunkSize : size * 1024 ,
22
22
} ) ;
23
- } ) ;
23
+ }
24
+ }
24
25
// 拿到 unicode -> subset 的报告
25
26
const sampleReporter : Mapper [ ] = [ ] ;
26
27
for ( const element of sample ) {
@@ -109,7 +110,7 @@ export async function main(build = false) {
109
110
} ) ;
110
111
}
111
112
112
- main ( ) ;
113
+ main ( true ) ;
113
114
114
115
type Mapper = Map < number , proto . OutputReport [ 'subsetDetail' ] [ number ] > ;
115
116
You can’t perform that action at this time.
0 commit comments