The library used for PDF creation is pdfmake
.
In order to display competitor local names correctly, we need to add additional fonts to pdfmake
.
bin/bundle_fonts.sh
downloads all the fonts we need and creates a JSON file
representing a virtual file system, which has the following form:
{ "filename": "Base-64 encoded file", ... }
This file goes to the public
directory, so that we can download it asynchronously in src/logic/pdfmake
.
Unfortunately a font is used only when we specify it explicitly.
In general it's fine to use the default Roboto font and do some additional work
only for competitor local names.
We determine which font should be used in src/logic/documents/pdf-utils.js
on the basis of Unicode block ranges.