Python script for exporting icons from icon font (e.g. Font Awesome, Octicons) as PNG images.
Project description
Python (2 & 3 compatible) script for exporting icons from icon font (e.g. Font Awesome, Octicons) as PNG images. It also comes with font-awesome-to-png script for backward compatibility.
Packages required for running and testing are listed in requirements directory.
Installation
Make sure you have required packages for Pillow installation.
With pip (recommended):
$ pip install icon_font_to_png
Without pip:
$ git clone https://github.com/Pythonity/icon-font-to-png $ pip install -r icon-font-to-png/requirements.txt $ cd icon-font-to-png/bin
Usage
usage: icon-font-to-png [-h] [--list] [--download {font-awesome,octicons}] [--ttf TTF-FILE] [--css CSS-FILE] [--size SIZE] [--scale SCALE] [--color COLOR] [--filename FILENAME] [--keep_prefix] [icons [icons ...]] Exports font icons as PNG images. optional arguments: -h, --help show this help message and exit --list list all available icon names and exit --download {font-awesome,octicons} download latest icon font and exit required arguments: --ttf TTF-FILE path to TTF file --css CSS-FILE path to CSS file exporting icons: icons names of the icons to export (or 'ALL' for all icons) --size SIZE icon size in pixels (default: 16) --scale SCALE scaling factor between 0 and 1, or 'auto' for automatic scaling (default: auto); be careful, as setting it may lead to icons being cropped --color COLOR HTML color code or name (default: black) --filename FILENAME name of the output file (without '.png' extension); it's used as a prefix if multiple icons are exported --keep_prefix do not remove common icon prefix (i.e. 'fa-arrow- right' instead of 'arrow-right')
Examples
Tests
Package was tested with tox on Python 2.7 and Python 3.4 (see tox.ini).
To run tests yourself, just run tox inside repository.
Contributions
Package source code is available at GitHub.
Feel free to use, ask, fork, star, report bugs, fix them, suggest enhancements and point out any mistakes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file icon_font_to_png-0.1.5.tar.gz
.
File metadata
- Download URL: icon_font_to_png-0.1.5.tar.gz
- Upload date:
- Size: 119.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ef13a211e0ac56200fecf68ddb226a6badd5e1439c002e5527ddeddd3fd978f |
|
MD5 | 786b1d817d2d9dba5245fef3a9232981 |
|
BLAKE2b-256 | 0a45108b946df983bfecae3eca37227ce5be3a949a639878b1cabf4081266a18 |
File details
Details for the file icon_font_to_png-0.1.5-py2.py3-none-any.whl
.
File metadata
- Download URL: icon_font_to_png-0.1.5-py2.py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1fe9016e2f5225f77b9a3e0e5403a7fc306b15015559aa00edf9e50e1fe1e33 |
|
MD5 | 72936660b02184324d49984b63d7fc2c |
|
BLAKE2b-256 | e7b88a111703b3e3a54d6c0ecf30ba501a8af6ae3d9852f0c3ca199e6208f9a8 |