bdf2sfd

BDF to SFD converter, allowing to vectorize bitmap fonts
Log | Files | Refs | README | LICENSE

commit bbc6342fd30d39a5d7b80fed13fb8b45267b79b7
parent 88469394b1040cddf0d72c7f2979461ac8d38b25
Author: Frederic Cambus <fred@statdns.com>
Date:   Tue,  3 Dec 2019 11:17:28 +0100

Parse ENCODING marker and start emitting output data.

Diffstat:
Msrc/bdftosfd.c | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/bdftosfd.c b/src/bdftosfd.c @@ -104,9 +104,23 @@ main(int argc, char *argv[]) { } bool readglyph = false; + char *token = NULL; + char *encoding; while (fgets(lineBuffer, LINE_LENGTH_MAX, bdfFile)) { if (*lineBuffer) { + if (!strncmp(lineBuffer, "ENCODING", 8)) { + token = strtok(lineBuffer, " \t"); + + if (token) + encoding = strtok(NULL, " \n"); + + if (encoding) + fprintf(stdout, "Encoding: %s %s %s\n", encoding, encoding, encoding); + + continue; + } + if (!strncmp(lineBuffer, "BITMAP", 6)) { readglyph = true; glyphes++;