<commit_before>To keep maintenance effort low for Osmic the repository contains only the base or "source" versions of icons. All the derivative versions can be generated by using a script.

This Python export script ([tools/export.py](https://github.com/nebulon42/osmic/blob/master/tools/export.py)) enables you to create your own customised collection of icons. It is able to:

* add padding
* add halos/outlines
* add shields
* re-colour icons
* create icon sprites
* export as SVG and PNG with different resolutions including retina (double sized) versions.

All parameters can be changed through a YAML configuration file. There are several examples in the script folder:

* [osm-carto-svg.yaml](https://github.com/nebulon42/osmic/blob/master/tools/osm-carto-svg.yaml) exports icons in SVG format like they are currently used in [openstreetmap-carto](https://github.com/gravitystorm/openstreetmap-carto) i.e. with 1px padding and without halo.
* [osm-carto-png.yaml](https://github.com/nebulon42/osmic/blob/master/tools/osm-carto-png.yaml) exports icons as PNG and re-colours them according to the colour scheme of [openstreetmap-carto](https://github.com/gravitystorm/openstreetmap-carto).
* [shields.yaml](https://github.com/nebulon42/osmic/blob/master/tools/shields.yaml) exports icons with shields.
* [sprites.yaml](https://github.com/nebulon42/osmic/blob/master/tools/sprites.yaml) exports the icons in a sprite like [this one](https://github.com/nebulon42/osmic/blob/master/icons@2x.png).

Such a configuration file must be supplied to the script as parameter e.g. execute `./tools/export.py tools/shields.yaml` in the main folder of Osmic.

The configuration file follows a simple organisational pattern for maximum versatility: all global icon parameters can be overridden by parameters specific to a certain icon id (except for sprites where only the colour can be changed). This is e.g. how re-colouring of icons works. An example of this pattern can be found in [osm-carto-png.yaml](https://github.com/nebulon42/osmic/blob/master/tools/osm-carto-png.yaml) where the global fill colour of `#734a08` is changed for the icon id `peak` to `#d08f55`.

In the following all possible parameters are listed. All of them are optional.

* `basedir` - specify the location based of which relative paths should be evaluated, if not specified it defaults to the location of the configuration file, must be an absolute path

* `input` - specify the input base directory, if not specified it defaults to the current working directory, can be either an absolute or relative path<commit_msg>updated export guide after adding icon font<commit_after>To keep maintenance effort low for Osmic the repository contains only the base or "source" versions of icons. All the derivative versions can be generated by using a script.

This Python export script ([tools/export.py](https://github.com/nebulon42/osmic/blob/master/tools/export.py)) enables you to create your own customised collection of icons. It is able to:

* add padding
* add halos/outlines
* add shields
* re-colour icons
* create icon sprites
* create an icon font with the help of [Font Custom](https://github.com/FontCustom/fontcustom/)
* export as SVG and PNG (through rsvg or Inkscape) with different resolutions including retina (double sized) versions.

All parameters can be changed through a YAML configuration file. There are several examples in the script folder:

* [font.yaml](https://github.com/nebulon42/osmic/blob/master/tools/font.yaml) creates an icon font of all icons.
* [osm-carto-png.yaml](https://github.com/nebulon42/osmic/blob/master/tools/osm-carto-png.yaml) exports icons as PNG and re-colours them according to the colour scheme of [openstreetmap-carto](https://github.com/gravitystorm/openstreetmap-carto).
* [osm-carto-svg.yaml](https://github.com/nebulon42/osmic/blob/master/tools/osm-carto-svg.yaml) exports icons in SVG format like they are currently used in [openstreetmap-carto](https://github.com/gravitystorm/openstreetmap-carto) i.e. with 1px padding and without halo.
* [osm-carto-svg-color.yaml](https://github.com/nebulon42/osmic/blob/master/tools/osm-carto-svg-color.yaml) exports icons in SVG format like they are currently used in [openstreetmap-carto](https://github.com/gravitystorm/openstreetmap-carto) i.e. with 1px padding and without halo and re-colours them according to their colour scheme.
* [shields.yaml](https://github.com/nebulon42/osmic/blob/master/tools/shields.yaml) exports icons with shields.
* [sprites.yaml](https://github.com/nebulon42/osmic/blob/master/tools/sprites.yaml) exports the icons in a sprite like [this one](https://github.com/nebulon42/osmic/blob/master/icons@2x.png).

Such a configuration file must be supplied to the script as parameter e.g. execute `./tools/export.py tools/shields.yaml` in the main folder of Osmic.

The configuration file follows a simple organisational pattern for maximum versatility: all global icon parameters can be overridden by parameters specific to a certain icon id (except for sprites where only the colour can be changed). This is e.g. how re-colouring of icons works. An example of this pattern can be found in [osm-carto-png.yaml](https://github.com/nebulon42/osmic/blob/master/tools/osm-carto-png.yaml) where the global fill colour of `#734a08` is changed for the icon id `peak` to `#d08f55`.

In the following all possible parameters are listed. All of them are optional.

* `basedir` - specify the location based of which relative paths should be evaluated, if not specified it defaults to the location of the configuration file, must be an absolute path

* `input` - specify the input base directory, if not specified it defaults to the current working directory, can be either an absolute or relative path
{'fraction_non_alphanumeric': 0.09013840830449826, 'fraction_numerical': 0.009515570934256055, 'mean_word_length': 4.68996062992126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 22, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '457401', 'n_tokens_mistral': 1728, 'n_tokens_neox': 1623, 'n_words': 651}