Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jun 2014 17:54:18 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r267012 - head/tools/tools/vt/fontcvt
Message-ID:  <201406031754.s53HsIsI095683@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Tue Jun  3 17:54:18 2014
New Revision: 267012
URL: http://svnweb.freebsd.org/changeset/base/267012

Log:
  vt fontcvt: Make the bold font optional
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/tools/tools/vt/fontcvt/fontcvt.c

Modified: head/tools/tools/vt/fontcvt/fontcvt.c
==============================================================================
--- head/tools/tools/vt/fontcvt/fontcvt.c	Tue Jun  3 17:53:11 2014	(r267011)
+++ head/tools/tools/vt/fontcvt/fontcvt.c	Tue Jun  3 17:54:18 2014	(r267012)
@@ -84,7 +84,7 @@ usage(void)
 {
 
 	fprintf(stderr,
-"usage: fontcvt [-w width] [-h height] normal.bdf bold.bdf out.fnt\n");
+"usage: fontcvt [-w width] [-h height] normal.bdf [bold.bdf] out.fnt\n");
 	exit(1);
 }
 
@@ -406,21 +406,27 @@ main(int argc, char *argv[])
 	argc -= optind;
 	argv += optind;
 
-	if (argc != 3)
+	if (argc < 2 || argc > 3)
 		usage();
 
 	wbytes = howmany(width, 8);
 
 	if (parse_bdf(argv[0], VFNT_MAP_NORMAL) != 0)
 		return (1);
-	if (parse_bdf(argv[1], VFNT_MAP_BOLD) != 0)
-		return (1);
+	argc--;
+	argv++;
+	if (argc == 2) {
+		if (parse_bdf(argv[0], VFNT_MAP_BOLD) != 0)
+			return (1);
+		argc--;
+		argv++;
+	}
 	number_glyphs();
 	fold_mappings(0);
 	fold_mappings(1);
 	fold_mappings(2);
 	fold_mappings(3);
-	if (write_fnt(argv[2]) != 0)
+	if (write_fnt(argv[0]) != 0)
 		return (1);
 	
 	printf(



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406031754.s53HsIsI095683>