cn-font-split
Version:
划时代的字体切割工具,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.
14 lines (13 loc) • 653 B
TypeScript
import { WriteFileOptions } from 'fs-extra';
import { api_interface } from './gen/index.js';
export type OriginInput = Parameters<(typeof api_interface.InputTemplate)['fromObject']>[0];
export type FontSplitProps = Omit<OriginInput, 'input' | 'subsets'> & {
outputFile?: IOutputFile;
input: string | Uint8Array;
subsets?: number[][];
/** 减少汇报日志 */
silent?: boolean;
};
/** 替换系统内部的文件输出方式 */
export type IOutputFile = (file: string, data: Uint8Array | string, options?: WriteFileOptions | undefined) => Promise<void>;
export type FontReporter = ReturnType<api_interface.OutputReport['toObject']>;