bdf2sfd

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

commit c7a813c2bd5c88861d31786fb829921b8562b854
parent 3b01b7183b0f55ffe58647cb875213783f87e010
Author: Frederic Cambus <fred@statdns.com>
Date:   Wed, 12 Feb 2020 11:00:50 +0100

Add a '-p' switch to allow specifying the PostScript font name.

Diffstat:
MREADME.md | 3++-
Mbdf2sfd.1 | 5++++-
Msrc/bdf2sfd.c | 11++++++++---
Msrc/header.c | 4++--
Msrc/header.h | 3++-
5 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md @@ -37,13 +37,14 @@ Packages are available for the following operating systems: ## Usage - bdf2sfd [-hv] [-f name] file + bdf2sfd [-hv] [-f name] [-p name] file If file is a single dash (`-'), bdf2sfd reads from the standard input. The options are as follows: -f name Specify font name. + -p name Specify PostScript font name. -h Display usage. -v Display version. diff --git a/bdf2sfd.1 b/bdf2sfd.1 @@ -24,7 +24,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: February 7 2020 $ +.Dd $Mdocdate: February 12 2020 $ .Dt BDF2SFD 1 .Os .Sh NAME @@ -34,6 +34,7 @@ .Nm .Op Fl hv .Op Fl f Ar name +.Op Fl p Ar name .Ar file .Sh DESCRIPTION .Nm @@ -51,6 +52,8 @@ The options are as follows: .Bl -tag -width 10n .It Fl f Ar name Specify font name. +.It Fl p Ar name +Specify PostScript font name. .It Fl h Display usage. .It Fl v diff --git a/src/bdf2sfd.c b/src/bdf2sfd.c @@ -4,7 +4,7 @@ * https://github.com/fcambus/bdf2sfd * * Created: 2019-11-21 - * Last Updated: 2020-02-08 + * Last Updated: 2020-02-12 * * bdf2sfd is released under the BSD 2-Clause license * See LICENSE file for details @@ -52,9 +52,10 @@ double runtime; void displayUsage() { - printf("bdf2sfd [-hv] [-f name] file \n\n" + printf("bdf2sfd [-hv] [-f name] [-p name] file \n\n" "The options are as follows:\n\n" " -f name Specify font name.\n" + " -p name Specify PostScript font name.\n" " -h Display usage.\n" " -v Display version.\n"); } @@ -81,12 +82,16 @@ main(int argc, char *argv[]) err(EXIT_FAILURE, "pledge"); } - while ((getoptFlag = getopt(argc, argv, "f:hv")) != -1) { + while ((getoptFlag = getopt(argc, argv, "f:p:hv")) != -1) { switch (getoptFlag) { case 'f': font.name = optarg; break; + case 'p': + font.psname = optarg; + break; + case 'h': displayUsage(); return EXIT_SUCCESS; diff --git a/src/header.c b/src/header.c @@ -4,7 +4,7 @@ * https://github.com/fcambus/bdf2sfd * * Created: 2019-11-21 - * Last Updated: 2020-02-08 + * Last Updated: 2020-02-12 * * bdf2sfd is released under the BSD 2-Clause license * See LICENSE file for details @@ -22,7 +22,7 @@ header(FILE *stream, struct fontinfo *font) gettimeofday(&tv, NULL); fprintf(stream, "SplineFontDB: 3.0\n"); - fprintf(stream, "FontName: %s\n", font->name); + fprintf(stream, "FontName: %s\n", font->psname); fprintf(stream, "FullName: %s\n", font->name); fprintf(stream, "FamilyName: %s\n", font->name); fprintf(stream, "Weight: Medium\n"); diff --git a/src/header.h b/src/header.h @@ -4,7 +4,7 @@ * https://github.com/fcambus/bdf2sfd * * Created: 2019-11-21 - * Last Updated: 2020-02-08 + * Last Updated: 2020-02-12 * * bdf2sfd is released under the BSD 2-Clause license * See LICENSE file for details @@ -17,6 +17,7 @@ struct fontinfo { char *name; + char *psname; char *chars; char *copyright; char *version;