No description
  • Java 92.2%
  • HTML 7.8%
Find a file
2026-05-07 17:16:57 +02:00
clevercloud web: add clever cloud build configuration 2024-11-26 21:51:16 +01:00
src web: change links to point to the new forge 2026-05-07 17:16:57 +02:00
licence.md Add licence : Hippocratic License Version Number: 2.1 2024-11-17 23:26:27 +01:00
pom.xml web: add a web base interface to convert TrueType font to GFX 2024-11-26 21:51:12 +01:00
readme.md readme: a note about unit tests possibly failing if some fonts are not installed on the system 2024-11-28 11:18:58 +01:00

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:

  • 7b 7 bits ascii, from 32 (space) to 127 (delete)
  • 8b 8 bits extended ascii, from 32 (space) to 255 (ÿ)
  • Temp useful 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.