bdf2sfd

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

commit e78ac5462ff285b7af5264838713b2add28691bd
parent 81981bceaa275efefee365b618dc4f334ccdc11f
Author: Frederic Cambus <fred@statdns.com>
Date:   Wed, 29 Jan 2020 23:35:02 +0100

Add a switch to allow setting font names, and fix getopt parameters.

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

diff --git a/src/bdftosfd.c b/src/bdftosfd.c @@ -78,8 +78,12 @@ main(int argc, char *argv[]) err(EXIT_FAILURE, "pledge"); } - while ((getoptFlag = getopt(argc, argv, "d:ghv")) != -1) { + while ((getoptFlag = getopt(argc, argv, "f:hv")) != -1) { switch (getoptFlag) { + case 'f': + font.name = optarg; + break; + case 'h': displayUsage(); return EXIT_SUCCESS; @@ -124,7 +128,7 @@ main(int argc, char *argv[]) while (fgets(lineBuffer, LINE_LENGTH_MAX, bdfFile)) { if (*lineBuffer) { - if (!strncmp(lineBuffer, "FAMILY_NAME ", 12)) { + if (!font.name && !strncmp(lineBuffer, "FAMILY_NAME ", 12)) { token = strtok(lineBuffer, " \t"); if (token)