Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This option was introduced many years ago and has since bit-rotted. I don't have fonts installed globally on my system, so I need to use the `--fonts` option. But without this commit, I get the following error when trying to use the `--fonts` option: ``` Traceback (most recent call last): File "/path/to/nik4.py", line 677, in <module> run(options) File "/path/to/nik4.py", line 422, in run mapnik.load_map_from_string(m, style_xml.encode("utf-8"), False, style_path) RuntimeError: no valid fonts could be loaded in FontSet 'fontset-0' in FontSet at line 15 ``` To fix this, load the fonts earlier. The exact place where we load them is not important, as long as it is above all calls to mapnik functions, which require fonts to be loaded (`mapnik.load_map_from_string()` currently). To be on the safe side regarding future modifications, I moved the code snippet pretty much to the top of the function, which results in this option working again.
- Loading branch information