Current Dev State

This commit is contained in:
Tim Lorsbach
2025-06-23 20:13:54 +02:00
parent b4f9bb277d
commit ded50edaa2
22617 changed files with 4345095 additions and 174 deletions

View File

@ -0,0 +1,33 @@
'use strict';
var theTTFToWOFF2Module = require('./ttf2woff2');
module.exports = function ttf2woff2(inputContent) {
// Prepare input
var inputBuffer = theTTFToWOFF2Module._malloc(inputContent.length + 1);
var outputSizePtr = theTTFToWOFF2Module._malloc(4);
var outputBufferPtr;
var outputSize;
var outputContent;
var i;
theTTFToWOFF2Module.writeArrayToMemory(inputContent, inputBuffer);
// Run
outputBufferPtr = theTTFToWOFF2Module.convert(
inputBuffer, inputContent.length, outputSizePtr
);
// Retrieve output
outputSize = theTTFToWOFF2Module.getValue(outputSizePtr, 'i32');
outputContent = new Buffer(outputSize);
for(i = 0; i < outputSize; i++) {
outputContent[i] = theTTFToWOFF2Module.getValue(outputBufferPtr + i, 'i8');
}
theTTFToWOFF2Module.freePtrs(outputBufferPtr, outputSizePtr);
return outputContent;
};

View File

@ -0,0 +1,6 @@
// This file need to be append to the build in order to work with browserify
// Shamelessly stolen here: https://github.com/fabiosantoscode/require-emscripten/blob/master/post-js.postjs
module.exports = Module;
// Do not recurse into module and waste all day
Module.inspect = function() { return '[Module]'; };

File diff suppressed because one or more lines are too long