A alpine based image to convert svg glyphs and generate TTF font using fontcustom.
This image includes:
This image defines a single volume:
- /fonts - Base directory where all works run
This image will copy all svg glyphs from /fonts/INPUT_FOLDER to a temporary directory.
After that, if choose, all glyphs will be converted from stroke to path. Some fonts need this step, like Feather.
Finally, Fontcustom is used to generate desired TTF font.
Help message :
docker run --rm -v WORK_DIRECTORY:/fonts lu0alv/svg-to-ttf-charmap -h
Usage: docker run --rm -v "${PWD}":/fonts lu0alv/svg-to-ttf-charmap [OPTIONS]
-g, --gid [GID] GroupId owner of the destination folder; default is equal to uid
-i, --input [FOLDER] Folder where svg glyphs lives; default is ./input
-n, --name FONT_NAME Name of the generated font
-c, --codepoint [CODEPOINT] Starting point for the character map, hexadecimal."
-o, --output [FOLDER] Destination folder for generated fonts; default is ./FONT_NAME
-s, --skip_conversion Skip the conversion from stroke to path
-u, --uid [UID] UserId owner of the destination folder; default is 0 (root)
-h, --help Show this help message
Simple font generation:
docker run --rm -v WORK_DIRECTORY:/fonts lu0alv/svg-to-ttf-charmap -n FONT_NAME
This command will read all svg glyphs from WORK_DIRECTORY/input and create a folder named FONT_NAME with generated TTF font into.
If you want to define another output folder:
docker run --rm -v WORK_DIRECTORY:/fonts lu0alv/svg-to-ttf-charmap -n FONT_NAME -o OUTPUT_FOLDER
If you want that the result of build respect your user:
docker run --rm -v WORK_DIRECTORY:/fonts lu0alv/svg-to-ttf-charmap -n FONT_NAME -u $(id -u)
(GID is optional)
If you dont need to convert stroke to path:
docker run --rm -v WORK_DIRECTORY:/fonts lu0alv/svg-to-ttf-charmap -n FONT_NAME -s
If you want to specify the starting point of the character map:
docker run --rm -v WORK_DIRECTORY:/fonts lu0alv/svg-to-ttf-charmap -n FONT_NAME -c e916
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
If you want to buy me a 🍺 :)
This is a fork of
rfbezerra's svg-to-ttf
repo
I modified to have the ability to specify the starting point of the charmap
using a new option -c
or --codepoint
.