Commit ddf8905 1 parent 692bab5 commit ddf8905 Copy full SHA for ddf8905
File tree 18 files changed +4329
-3427
lines changed
18 files changed +4329
-3427
lines changed Original file line number Diff line number Diff line change 3
3
![ updateTime] ( https://img.shields.io/badge/更新时间-2024/03/23-green )
4
4
![ author] ( https://img.shields.io/badge/author-江夏尧-green )
5
5
![ npmVersion] ( https://img.shields.io/badge/LTS_version-4.12.0-green )
6
- [ ![ ] ( https://data.jsdelivr.com/v1/package/npm/@konghayao/ cn-font-split/badge )] ( https://www.jsdelivr.com/package/npm/@konghayao /cn-font-split )
6
+ [ ![ ] ( https://data.jsdelivr.com/v1/package/npm/cn-font-split/badge )] ( https://www.jsdelivr.com/package/npm/cn-font-split )
7
7
8
8
![ CodeFactor] ( https://www.codefactor.io/repository/github/konghayao/cn-font-split/badge )
9
9
![ NPM License] ( https://img.shields.io/npm/l/%40konghayao%2Fcn-font-split )
@@ -61,8 +61,8 @@ Nodejs 版本推荐使用 **大于 18 的版本**。如低级版本或者其他
61
61
❗ 注意您安装的版本不是 beta 版本。如果是 beta 版本可能会引起一些问题。
62
62
63
63
``` bash
64
- npm install @konghayao/ cn-font-split
65
- npm install @konghayao/ cn-font-split -g # 如果使用命令行,推荐全局安装
64
+ npm install cn-font-split
65
+ npm install cn-font-split -g # 如果使用命令行,推荐全局安装
66
66
```
67
67
68
68
### 命令行使用
@@ -81,9 +81,9 @@ cn-font-split -h
81
81
### 写打包代码
82
82
83
83
``` js
84
- import { fontSplit } from ' @konghayao/ cn-font-split' ;
85
- // import { fontSplit } from "@konghayao/ cn-font-split/dist/browser/index.js";
86
- // import { fontSplit } from "https://cdn.jsdelivr.net/npm/@konghayao/ [email protected] /dist/browser/index.js";
84
+ import { fontSplit } from ' cn-font-split' ;
85
+ // import { fontSplit } from "cn-font-split/dist/browser/index.js";
86
+ // import { fontSplit } from "https://cdn.jsdelivr.net/npm/[email protected] /dist/browser/index.js";
87
87
88
88
fontSplit ({
89
89
FontPath: ' ./fonts/SourceHanSerifCN-Bold.ttf' , // 推荐使用 otf、ttf 字体
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ import {
4
4
fontSplit ,
5
5
Assets ,
6
6
DenoAdapter ,
7
- } from 'https://cdn.jsdelivr.net/npm/@konghayao/ cn-font-split/dist/browser/index.js' ;
7
+ } from 'https://cdn.jsdelivr.net/npm/cn-font-split/dist/browser/index.js' ;
8
8
await DenoAdapter ( ) ;
9
9
Assets . pathTransform = ( innerPath ) =>
10
10
innerPath . replace (
11
11
'./' ,
12
- 'https://cdn.jsdelivr.net/npm/@konghayao/ cn-font-split/dist/browser/' ,
12
+ 'https://cdn.jsdelivr.net/npm/cn-font-split/dist/browser/' ,
13
13
) ;
14
14
15
15
Original file line number Diff line number Diff line change 11
11
"license" : " ISC" ,
12
12
"dependencies" : {
13
13
"@japont/unicode-range" : " ^1.0.0" ,
14
- "@konghayao/ cn-font-split" : " workspace:^" ,
14
+ "cn-font-split" : " workspace:^" ,
15
15
"byte-size" : " ^8.1.1" ,
16
16
"solid-js" : " ^1.7.8"
17
17
}
Original file line number Diff line number Diff line change 1
- import { fontSplit , getSubsetsFromCSS } from '@konghayao/ cn-font-split' ;
1
+ import { fontSplit , getSubsetsFromCSS } from 'cn-font-split' ;
2
2
import fs from 'node:fs' ;
3
3
const noto = fs . readFileSync ( './css/noto.css' , 'utf-8' ) ;
4
4
await fontSplit ( {
Original file line number Diff line number Diff line change 3
3
![ updateTime] ( https://img.shields.io/badge/更新时间-2024/03/23-green )
4
4
![ author] ( https://img.shields.io/badge/author-江夏尧-green )
5
5
![ npmVersion] ( https://img.shields.io/badge/LTS_version-4.12.0-green )
6
- [ ![ ] ( https://data.jsdelivr.com/v1/package/npm/@konghayao/ cn-font-split/badge )] ( https://www.jsdelivr.com/package/npm/@konghayao /cn-font-split )
6
+ [ ![ ] ( https://data.jsdelivr.com/v1/package/npm/cn-font-split/badge )] ( https://www.jsdelivr.com/package/npm/cn-font-split )
7
7
8
8
![ CodeFactor] ( https://www.codefactor.io/repository/github/konghayao/cn-font-split/badge )
9
9
![ NPM License] ( https://img.shields.io/npm/l/%40konghayao%2Fcn-font-split )
@@ -59,8 +59,8 @@ Nodejs 版本推荐使用 **大于 18 的版本**。如低级版本或者其他
59
59
❗ 注意您安装的版本不是 beta 版本。如果是 beta 版本可能会引起一些问题。
60
60
61
61
``` bash
62
- npm install @konghayao/ cn-font-split
63
- npm install @konghayao/ cn-font-split -g # 如果使用命令行,推荐全局安装
62
+ npm install cn-font-split
63
+ npm install cn-font-split -g # 如果使用命令行,推荐全局安装
64
64
```
65
65
66
66
### 命令行使用
@@ -79,9 +79,9 @@ cn-font-split -h
79
79
### 写打包代码
80
80
81
81
``` js
82
- import { fontSplit } from ' @konghayao/ cn-font-split' ;
83
- // import { fontSplit } from "@konghayao/ cn-font-split/dist/browser/index.js";
84
- // import { fontSplit } from "https://cdn.jsdelivr.net/npm/@konghayao/ [email protected] /dist/browser/index.js";
82
+ import { fontSplit } from ' cn-font-split' ;
83
+ // import { fontSplit } from "cn-font-split/dist/browser/index.js";
84
+ // import { fontSplit } from "https://cdn.jsdelivr.net/npm/[email protected] /dist/browser/index.js";
85
85
86
86
fontSplit ({
87
87
FontPath: ' ./fonts/SourceHanSerifCN-Bold.ttf' , // 推荐使用 otf、ttf 字体
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " @konghayao/ cn-font-split" ,
2
+ "name" : " cn-font-split" ,
3
3
"version" : " 4.15.0" ,
4
4
"description" : " 中文 web font 切割工具" ,
5
5
"main" : " dist/index.js" ,
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export const createHeaderComment = (
16
16
: '' ;
17
17
const baseMessage =
18
18
commentSetting . base !== false
19
- ? `Generated By cn-font-split@${ __cn_font_split_version__ } https://www.npmjs.com/package/@konghayao/ cn-font-split` +
19
+ ? `Generated By cn-font-split@${ __cn_font_split_version__ } https://www.npmjs.com/package/cn-font-split` +
20
20
`\nCreateTime: ${ new Date ( ) . toUTCString ( ) } ;`
21
21
: '' ;
22
22
const header = `/* ` + baseMessage + nameTableString + '\n */\n\n' ;
Original file line number Diff line number Diff line change @@ -2,14 +2,14 @@ import {
2
2
fontSplit ,
3
3
Assets ,
4
4
DenoAdapter ,
5
- } from 'https://cdn.jsdelivr.net/npm/@konghayao/ cn-font-split/dist/browser/index.js' ;
5
+ } from 'https://cdn.jsdelivr.net/npm/cn-font-split/dist/browser/index.js' ;
6
6
import fs from 'https://esm.sh/fs-extra' ;
7
7
fs . emptyDirSync ( './temp/deno' ) ;
8
8
await DenoAdapter ( ) ;
9
9
Assets . pathTransform = ( innerPath ) =>
10
10
innerPath . replace (
11
11
'./' ,
12
- 'https://cdn.jsdelivr.net/npm/@konghayao/ cn-font-split/dist/browser/' ,
12
+ 'https://cdn.jsdelivr.net/npm/cn-font-split/dist/browser/' ,
13
13
) ;
14
14
console . log ( Assets ) ;
15
15
fontSplit ( {
Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ fontSplit({
28
28
// unicodes: true
29
29
// }
30
30
} ,
31
+ logger : {
32
+ settings : {
33
+ minLevel : 4
34
+ }
35
+ }
31
36
// autoChunk: false,
32
37
// subsets: [[31105, 8413]],
33
38
// threads: {},
Original file line number Diff line number Diff line change 20
20
"solidjs-use" : " ^2.3.0"
21
21
},
22
22
"devDependencies" : {
23
- "@konghayao/ cn-font-split" : " workspace:^" ,
23
+ "cn-font-split" : " workspace:^" ,
24
24
"@playwright/test" : " ^1.44.1" ,
25
25
"@types/pngjs" : " ^6.0.5" ,
26
26
"@types/shelljs" : " ^0.8.15"
Original file line number Diff line number Diff line change 1
- import { fontSplit } from "@konghayao/ cn-font-split" ;
1
+ import { fontSplit } from "cn-font-split" ;
2
2
3
3
await fontSplit ( {
4
4
destFold : './temp/SourceHanSerifSC-VF/' ,
Original file line number Diff line number Diff line change 1
1
import fs from 'fs-extra' ;
2
2
import _ from 'lodash-es' ;
3
- import { fontSplit , convert } from '@konghayao/ cn-font-split' ;
3
+ import { fontSplit , convert } from 'cn-font-split' ;
4
4
const features = fs . readJSONSync ( './FeatureConfig.json' ) ;
5
5
const allKey = new Set ( ) ;
6
6
Original file line number Diff line number Diff line change 1
1
import fs from 'fs-extra' ;
2
2
import _ from 'lodash-es'
3
- import { convert } from '@konghayao/ cn-font-split' ;
3
+ import { convert } from 'cn-font-split' ;
4
4
import shelljs from 'shelljs'
5
5
const features = fs . readJSONSync ( './FeatureConfig.json' ) ;
6
6
Original file line number Diff line number Diff line change 1
1
import fs from 'fs-extra' ;
2
2
import _ from 'lodash-es'
3
- import { convert } from '@konghayao/ cn-font-split' ;
3
+ import { convert } from 'cn-font-split' ;
4
4
const features = fs . readJSONSync ( './FeatureConfig.json' ) ;
5
5
6
- const wasmBlob = await fs . readFile ( './node_modules/@konghayao/ cn-font-split/dist/browser/hb-subset.wasm' )
6
+ const wasmBlob = await fs . readFile ( './node_modules/cn-font-split/dist/browser/hb-subset.wasm' )
7
7
const { instance : { exports } } = await WebAssembly . instantiate ( wasmBlob ) ;
8
8
9
9
Original file line number Diff line number Diff line change 48
48
"vite" : " ^5"
49
49
},
50
50
"dependencies" : {
51
- "@konghayao/ cn-font-split" : " workspace:^" ,
51
+ "cn-font-split" : " workspace:^" ,
52
52
"fs-extra" : " ^11.2.0" ,
53
53
"glob" : " ^10.4.1"
54
54
},
Original file line number Diff line number Diff line change 1
1
declare module '@konghayao/_font_' {
2
- import { fontSplit } from '@konghayao/ cn-font-split' ;
2
+ import { fontSplit } from 'cn-font-split' ;
3
3
type Reporter = Awaited < ReturnType < typeof fontSplit > > ;
4
4
export const css : Reporter [ 'css' ] ;
5
5
}
Original file line number Diff line number Diff line change 1
- import { InputTemplate , fontSplit } from '@konghayao/ cn-font-split' ;
1
+ import { InputTemplate , fontSplit } from 'cn-font-split' ;
2
2
import path from 'path' ;
3
3
import fs from 'fs' ;
4
4
import url from 'url' ;
You can’t perform that action at this time.
0 commit comments