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.

2 lines 885 B
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../load.js"),t=require("../gen/index.js"),n=require("../decodeReporter.js"),r=require("../createAPI.js");var i=Deno,a=i.env.get(`CN_FONT_SPLIT_BIN`);a||=new URL(`../`+e.getBinName(e.matchPlatform(process.platform,process.arch,()=>!1)),require("url").pathToFileURL(__filename).href);var o=i.dlopen(a,{font_split:{parameters:[`buffer`,`usize`,`function`],result:`void`}}),s=r.createAPI(o.symbols.font_split,e=>new i.UnsafeCallback({parameters:[`pointer`,`usize`],result:`void`},(t,n)=>{let r=new i.UnsafePointerView(t).getArrayBuffer(Number(n));e(new Uint8Array(r.slice()))}).pointer);exports.createAPI=r.createAPI,exports.decodeReporter=n.decodeReporter,exports.fontSplit=s,Object.defineProperty(exports,"proto",{enumerable:!0,get:function(){return t.api_interface}}); //# sourceMappingURL=index.js.map