Skip to content

HexRx/mcufont-converter-web

Repository files navigation

mcufont-converter-web

TTF font to C code converter for the embedded mcufont font library. The project is based on mcufont encoder https://github.com/mcufont/mcufont/blob/master/encoder/main.cc and WebAssembly.

Clone the project

git clone --recurse-submodules https://github.com/HexRx/mcufont-converter-web.git

How to build a WebAssembly part

Use Emscripten toolchain with docker

docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) -w /src/build emscripten/emsdk emcmake cmake -DCMAKE_BUILD_TYPE=Release ..
docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) -w /src/build emscripten/emsdk emmake make

Description of Emscripten parameters

STACK_SIZE=131072 - requires for recursion function fill_tree_suffixes(). ALLOW_MEMORY_GROWTH=1 - handling fonts with a large number of glyphs.

Preact frontend part

License

This project is licensed under the MIT License - see the LICENSE file for details.