bdf2sfd

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

commit 692ac05ddb5da7fd419db7018b665b4b46125746
parent 2374ac0a86352476577399eb86c01b643e83b76c
Author: Frederic Cambus <fred@statdns.com>
Date:   Mon, 20 Jan 2020 22:10:47 +0100

Parse font family name and emit the data in output.

Diffstat:
Msrc/bdftosfd.c | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/bdftosfd.c b/src/bdftosfd.c @@ -112,12 +112,19 @@ main(int argc, char *argv[]) struct fontinfo font; - font.name = "Spleen"; - int32_t x, y; while (fgets(lineBuffer, LINE_LENGTH_MAX, bdfFile)) { if (*lineBuffer) { + if (!strncmp(lineBuffer, "FAMILY_NAME ", 12)) { + token = strtok(lineBuffer, " \t"); + + if (token) + font.name = strdup(strtok(NULL, "\n")); + + continue; + } + if (!strncmp(lineBuffer, "COPYRIGHT ", 10)) { token = strtok(lineBuffer, " \t");