<commit_before># google-webfonts-json-encoder

Download and encode, as base64 json, google fonts, downloaded from [google-webfonts-helper service](https://github.com/majodev/google-webfonts-helper).
This tool is intended to be used in the build process of BaseKit app, but can be easily adapted to use in any other project).

## Quick guide 

Installation: `npm install google-webfonts-json-encoder`

Usage: `node gwjencoder -l config/google_fonts.yml -d assets/public/fonts -s=latin,latin-ext -f=woff,woff2`

Where -l is the path of a yml file listing the desired fonts (legacy format used in the app),
-d is the folder to store the fonts, and -s the desired subsets of fonts.

## How to use
This is intended to be part of an automated build process depending on the required fonts for a given target environment.

The complete list of command line options are:

* l: path to the yml file, defaults to config/google_fonts.yml.

* d: target folder, defaults to current one.

* f: fonts format to download, defaults to woff,woff2,ttf.

## YAML font list
This is an example of our format, if you use another one, just adapt it to your own.

---

fonts:

    latin:

        subset: 'latin'

        fonts:

            - family: 'Droid+Sans'<commit_msg>Fix documentation about how to run the command<commit_after># google-webfonts-json-encoder

Download and encode, as base64 json, google fonts, downloaded from [google-webfonts-helper service](https://github.com/majodev/google-webfonts-helper).
This tool is intended to be used in the build process of BaseKit app, but can be easily adapted to use in any other project).

## Quick guide 

Installation: `npm install google-webfonts-json-encoder`

Usage: `node --harmony gwjencoder -l config/google_fonts.yml -d assets/public/fonts -s=latin,latin-ext -f=woff,woff2`

The minimun version of node needed to run it is 0.12.

Where -l is the path of a yml file listing the desired fonts (legacy format used in the app),
-d is the folder to store the fonts, and -s the desired subsets of fonts.

## How to use
This is intended to be part of an automated build process depending on the required fonts for a given target environment.

The complete list of command line options are:

* l: path to the yml file, defaults to config/google_fonts.yml.

* d: target folder, defaults to current one.

* f: fonts format to download, defaults to woff,woff2,ttf.

## YAML font list
This is an example of our format, if you use another one, just adapt it to your own.

---

fonts:

    latin:

        subset: 'latin'

        fonts:

            - family: 'Droid+Sans'
{'fraction_non_alphanumeric': 0.07769230769230769, 'fraction_numerical': 0.004230769230769231, 'mean_word_length': 3.6035398230088496, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2573139', 'n_tokens_mistral': 820, 'n_tokens_neox': 773, 'n_words': 362}