<commit_before>

Localization
------------

Currently we use Qt Linguist.
(TODO: mark strings with tr(), and check that it works.)
We could switch to gettext if you prefer.

Fonts
-----

To add (or remove) a font, you need to make the following changes:
* Add a .ttf font file to resources/
* Remember that Lasercake is GPLed so you shall also:
  Include your most-preferred format for editing the font next to the .ttf.
* List this file in fonts.qrc
* Add another QFontDatabase::addApplicationFont line in main.cpp
* Find out the "font name" of the font so you can refer to it in your code
* Rebuild Lasercake (these fonts are embedded in the executable)


Cross-compiling
---------------

Notes:

### emscripten ###

This might not entirely work yet, but for starters:

- Extra CMake arguments (Arch Linux, Nov 2015):
    -DCMAKE_TOOLCHAIN_FILE=/usr/lib/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CXX_FLAGS='-s DEMANGLE_SUPPORT=1 -DBOOST_NO_EXCEPTIONS=1' -DUSE_QT=NO

The path to the toolchain file might be different for you.
See https://github.com/kripken/emscripten/blob/master/src/settings.js for
more "-s" Emscripten flags you might be interested in. If you want
to turn exceptions back on (at a performance cost), remove
`-DBOOST_NO_EXCEPTIONS=1` and add `-s DISABLE_EXCEPTION_CATCHING=0` in its
place.

You could run it from the command line by
`(cd [the directory where Lasercake.js is]; node Lasercake.js --help)`
although that's kind of silly because the hope is it will have
a browser UI.  The main use for running it from the command line
is that --run-self-tests works.  You may have to use `nodejs` instead
of `node` on some versions of Debian.  (You may have to install
Node.js for this.  Node probably isn't necessary for the build process,<commit_msg>improve emscripten-build readme<commit_after>

Localization
------------

Currently we use Qt Linguist.
(TODO: mark strings with tr(), and check that it works.)
We could switch to gettext if you prefer.

Fonts
-----

To add (or remove) a font, you need to make the following changes:
* Add a .ttf font file to resources/
* Remember that Lasercake is GPLed so you shall also:
  Include your most-preferred format for editing the font next to the .ttf.
* List this file in fonts.qrc
* Add another QFontDatabase::addApplicationFont line in main.cpp
* Find out the "font name" of the font so you can refer to it in your code
* Rebuild Lasercake (these fonts are embedded in the executable)


Cross-compiling
---------------

Notes:

### emscripten ###

This might not entirely work yet, but for starters:

- Extra CMake arguments (Arch Linux, Nov 2015):
    -DCMAKE_TOOLCHAIN_FILE="$EMSCRIPTEN/cmake/Modules/Platform/Emscripten.cmake" -DCMAKE_CXX_FLAGS='-s DEMANGLE_SUPPORT=1 -DBOOST_NO_EXCEPTIONS=1' -DUSE_QT=NO

The path to the toolchain file might be different for you.
Example values of $EMSCRIPTEN are /usr/lib/emscripten or
.../emsdk_portable/emscripten/master.

See https://github.com/kripken/emscripten/blob/master/src/settings.js for
more "-s" Emscripten flags you might be interested in. If you want
to turn exceptions back on (at a performance cost), remove
`-DBOOST_NO_EXCEPTIONS=1` and add `-s DISABLE_EXCEPTION_CATCHING=0` in its
place.

You could run it from the command line by
`(cd [the directory where Lasercake.js is]; node Lasercake.js --help)`
although that's kind of silly because the hope is it will have
a browser UI.  The main use for running it from the command line
is that --run-self-tests works.  You may have to use `nodejs` instead
of `node` on some versions of Debian.  (You may have to install
Node.js for this.  Node probably isn't necessary for the build process,
{'fraction_non_alphanumeric': 0.08967391304347826, 'fraction_numerical': 0.004347826086956522, 'mean_word_length': 3.869047619047619, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '629918', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1110, 'n_words': 507}