Export Font Glyphs to Telegram Animated Sticker Format
- Python 3.x
Install pip dependencies
pip install -r requirements.txtNote: If you use python virtual environments, do not forget to create and activate it before installing dependencies.
Assume that you have font file SomeFonts.ttf (or OpenType), then input all the characters you want to export in characters.txt.
python3 ttf2tgs.py SomeFonts.ttf characters.txtAnd you will get Telegram Animated Sticker files under the tgs folder.
options:
-h, --help show this help message and exit
--output OUTPUT target directory to the output TGS files, default ./tgs
--scale SCALE output image scale factor, between 0 and 1.0
--svg save glyph SVG files
--color COLOR fill color for SVG glyphs (default black, or white with outline enabled)
--outline enable outline stroke for SVG glyphs
--outline-color OUTLINE_COLOR
color of outline stroke, default #000000
--outline-thickness OUTLINE_THICKNESS
stroke width for outline in font units, default 5, between 1 and 9- fonttools - A library to manipulate font files from Python.
- python-lottie - Python framework to manipulate lottie / telegram animated sticker files