Skip to content

rfbezerra/svg-to-ttf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

svg-to-ttf

A alpine based image to convert svg glyphs and generate TTF font using fontcustom.

This image includes:

Volumes

This image defines a single volume:

  • /fonts - Base directory where all works run

Process

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.

Use

Help message :

docker run --rm -v WORK_DIRECTORY:/fonts rfbezerra/svg-to-ttf -h
Usage: docker run --rm -v "${PWD}":/fonts rfbezerra/svg-to-ttf [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
  -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 rfbezerra/svg-to-ttf -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 rfbezerra/svg-to-ttf -n FONT_NAME -o OUTPUT_FOLDER

If you want that the result of build respect your user:

docker run --rm -v WORK_DIRECTORY:/fonts rfbezerra/svg-to-ttf -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 rfbezerra/svg-to-ttf -n FONT_NAME -s

Contributing

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Thanks

Donate

If you want to buy me a 🍺 :)

About

Docker image to generate TTF font from svg glyphs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published