UNPKG

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.

1 lines 1.32 kB
{"version":3,"file":"auto.mjs","names":[],"sources":["../src/auto.ts"],"sourcesContent":["import { FontSplitProps } from './interface.js';\n\nconst loadFontSplit = async () => {\n let fontSplit = null;\n /** @ts-ignore */\n if (typeof globalThis.Bun !== 'undefined') {\n console.log('cn-font-split using Bun Native FFI');\n fontSplit = (await import('./bun/index.js')).fontSplit;\n /** @ts-ignore */\n } else if (typeof globalThis.Deno !== 'undefined') {\n console.log('cn-font-split using Deno Native FFI');\n fontSplit = (await import('./deno/index.js')).fontSplit;\n } else {\n console.log('cn-font-split using Node FFI');\n fontSplit = (await import('./node/index.js')).fontSplit;\n }\n return fontSplit;\n};\n\nconst f = loadFontSplit();\nlet fontSplit = async (config: FontSplitProps) => {\n return (await f)(config);\n};\nexport * from './interface.js';\nexport * from './createAPI.js';\nexport { fontSplit };\nexport default fontSplit;\n"],"mappings":";;;AAmBA,IAAM,KAAI,YAjBwB;CAC9B,IAAI,IAAY;CAahB,OAXW,WAAW,QAAQ,SAIZ,WAAW,SAAS,UAIlC,QAAQ,IAAI,8BAA8B,GAC1C,KAAa,MAAM,OAAO,qBAAoB,cAJ9C,QAAQ,IAAI,qCAAqC,GACjD,KAAa,MAAM,OAAO,qBAAoB,cAL9C,QAAQ,IAAI,oCAAoC,GAChD,KAAa,MAAM,OAAO,oBAAmB,YAS1C;AACX,GAEwB,GACpB,IAAY,OAAO,OACX,MAAM,GAAG,CAAM"}