Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Mar 2016 21:32:46 +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: r296920 - head/usr.bin/vtfontcvt
Message-ID:  <201603152132.u2FLWkNR088326@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Tue Mar 15 21:32:46 2016
New Revision: 296920
URL: https://svnweb.freebsd.org/changeset/base/296920

Log:
  vtfontcvt: support .hex fonts with characters beyond the Unicode BMP
  
  This is already supported by the vt(4) vfnt format mapping from code
  points to glyphs. Update the .hex font parser to accept up to six hex
  digits.

Modified:
  head/usr.bin/vtfontcvt/vtfontcvt.c

Modified: head/usr.bin/vtfontcvt/vtfontcvt.c
==============================================================================
--- head/usr.bin/vtfontcvt/vtfontcvt.c	Tue Mar 15 21:21:28 2016	(r296919)
+++ head/usr.bin/vtfontcvt/vtfontcvt.c	Tue Mar 15 21:32:46 2016	(r296920)
@@ -315,12 +315,13 @@ parse_hex(FILE *fp, unsigned int map_idx
 			if (bytes != NULL)
 				errx(1, "malformed input: Width tag after font data");
 			set_width(atoi(ln + 9));
-		} else if (sscanf(ln, "%4x:", &curchar)) {
+		} else if (sscanf(ln, "%6x:", &curchar)) {
 			if (bytes == NULL) {
 				bytes = xmalloc(wbytes * height);
 				bytes_r = xmalloc(wbytes * height);
 			}
-			p = ln + 5;
+			/* ln is guaranteed to have a colon here. */
+			p = strchr(ln, ':') + 1;
 			chars_per_row = strlen(p) / height;
 			dwidth = width;
 			if (chars_per_row / 2 > (width + 7) / 8)



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