Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tmpstpdwn/ttf2png
TTF to PNG Converter
https://github.com/tmpstpdwn/ttf2png
bash image imagemagick linux rice shell ttf2png unix
Last synced: 1 day ago
JSON representation
TTF to PNG Converter
- Host: GitHub
- URL: https://github.com/tmpstpdwn/ttf2png
- Owner: tmpstpdwn
- License: gpl-3.0
- Created: 2024-06-13T15:28:34.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-09-17T05:57:44.000Z (4 months ago)
- Last Synced: 2024-11-14T13:11:46.088Z (2 months ago)
- Topics: bash, image, imagemagick, linux, rice, shell, ttf2png, unix
- Language: Shell
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TTF to PNG Converter
This script converts a single glyph from a TrueType font to a PNG image using ImageMagick. It allows you to specify the font, glyph, color, and output file path.
## Why ??
I made this small script to help me in displaying nerd font glyphs in [dunst](https://github.com/dunst-project/dunst) as dunst only has support for png's for notifcation icons.
## Dependancies
- ImageMagick: Ensure that the magick command is available on your system. You can install ImageMagick using package managers like apt, yum, or brew.
## Installation
move/copy `src/ttf2png` to a directory under `$PATH` varible for global access.
## Usage
``` bash
ttf2png.sh -f FONT -g GLYPH -c COLOR -p OUTPUT
```
- -f FONT: Name of the TTF font (without extension).
- -g GLYPH: Glyph to convert.
- -c COLOR: Color of the glyph (hex code, optional). If not provided, the default color is used.
- -p OUTPUT: Output file path for the PNG image.Example:
``` bash
ttf2png -f "MononokiNerdFont-Bold" -g "" -p "/tmp/downloadicon"
```## Color Source
- If color provided explicitly then that color will be used for png foreground.
- If not, The script attempts to source colors from [`shwal`](https://github.com/tmpstpdwn/Shwal) or [`pywal`](https://github.com/dylanaraps/pywal) if they are installed.
- If neither of the above works then the default foreground color is set to #FFFFFF.## License
This project is licensed under the GPL3 License - see the [LICENSE](LICENSE) file for details.