diff options
author | MichaĆ Wolny <FreexD@users.noreply.github.com> | 2021-04-11 08:48:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-11 08:48:38 +0200 |
commit | a925fd5937e480ae98f80a22474be7e8839667cd (patch) | |
tree | 2233e55d6ccd0a2364f6383aac97bc5c0dff1bc9 /README.md | |
parent | Merge pull request #121 from tijmenvangulik/patchssbranch (diff) | |
parent | Added brackets and fixed ident (diff) | |
download | tabler-icons-a925fd5937e480ae98f80a22474be7e8839667cd.tar.xz |
Merge pull request #120 from tijmenvangulik/master
Make it easier to compile a font with sub set of icons
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -127,6 +127,45 @@ To load a specific version replace `latest` with the desired version number. <script src="https://unpkg.com/@tabler/icons@1.36.0/icons-react/dist/index.umd.js"></script> ``` +Compiling fonts: + +To compile fonts first install [fontforge](https://fontforge.org/en-US/) + +When compiling the font it will look for a json file compile-options.json in root folder (same folder as the package.json) In this file you can define extra options: + +The default settings if you have not defined the file will be: +{ + "includeIcons": [], + "fontForge": "fontforge", + "strokeWidth": 2 +} + +The fontforge executable needs to be in the path or you can set set the path to the downloaded fontforge executable in the. If you installed in on a mac in your application directory it will be "/Applications/FontForge.app/Contents/MacOS/FontForge". You can set this value in the compile-options.json file. + +```JSON + { + "fontForge":"/Applications/FontForge.app/Contents/MacOS/FontForge" + } +``` +To compile the fonts run: + npm run build-iconfont + +By default the stroke width is 2. You can change the stroke width in the compile-options.json + +```JSON + { + "strokeWidth": 1.5, + } +``` + +To reduce the font file size you can choose to compile a sub set of icons. When you leave the array empty it will compile all the fonts. To compile only two icons you can set for example the folowing option in the compile-options.json: + +```JSON + { + "includeIcons":["alert-octagon","alert-triangle"] + } +``` + ### Svelte You can use [`tabler-icons-svelte`](https://github.com/benflap/tabler-icons-svelte) to use icons in your Svelte projects (see [example](https://svelte.dev/repl/e80dc63d7019431692b10a77525e7f99?version=3.31.0)): |