- Java 92.2%
- HTML 7.8%
| clevercloud | ||
| src | ||
| licence.md | ||
| pom.xml | ||
| readme.md | ||
TTF 2 GFX : convert TTF font to Adafruit GFX format
A command line tool to convert a TrueType font to be used with Adafruit GFX library.
Build
The project is written in java 21 and build with maven. In the main directory :
mvn package
Note: Currently, some unit tests use font installed on my systems that might not be on yours (or not identical) and those test might fail.
You can use the option -DskipTests to package without running the unit test. I'll fix that (when it'll be a pb for me, or someone asks nicely :).
Command line interface
Usage
The CLI can be called with 2 commands.
convert
Convert the given font to GFX format.
java -jar target/ttf2gfx-1.0-SNAPSHOT.jar convert [-hoV] [-s=<charset> | [[-c=<char>]...
[-f=<firstChar> -l=<lastChar>]]] <fontName>
<fontSize>
<fontName> The font name to be transformed
<fontSize> The font size
-c, --char=<char> Char to be included in the font. Repeat as many
times you need.
-f, --first=<firstChar> The first char to include in the font
-h, --help Show this help message and exit.
-l, --last=<lastChar> The last char to be included in the font
-o Output the result to file named after the font if
specified, otherwise stdout
-s=<charset> Use fixed set of chars. Value can be "7b", "8b",
"Temp"
-V, --version Print version information and exit.
The fixed char set of -s option are:
7b7 bits ascii, from 32 (space) to 127 (delete)8b8 bits extended ascii, from 32 (space) to 255 (ÿ)Tempuseful chars to display temperature '+', '-', '0' to '9', ', ',', '.', '°', 'C', 'F'
list
List the name of fonts available.
java -jar target/ttf2gfx-1.0-SNAPSHOT.jar list
List the name of fonts available.
Server
There is a small web server that provide another UI for the tool. It should be running on [https://ttf2gfx.crafting-labs.fr/].
run
java -cp target/ttf2gfx-1.0-SNAPSHOT.jar fr.craftinglabs.apps.ttf2gfx.web.Server
By default, the server will be listening on port 8080. From your web browser you should be able to access it on http://localhost:8080/.
The default port can be overriden by setting the environment variable PORT to the port number you'd like.
Licence
'ttf2gfx' is released under The Hippocratic License 2.1.