Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Apr 2018 12:58:53 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r332323 - stable/10/usr.bin/vtfontcvt
Message-ID:  <201804091258.w39Cwr3p014349@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Mon Apr  9 12:58:53 2018
New Revision: 332323
URL: https://svnweb.freebsd.org/changeset/base/332323

Log:
  MFC r296920: vtfontcvt: support .hex fonts with chars beyond 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.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/10/usr.bin/vtfontcvt/vtfontcvt.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c
==============================================================================
--- stable/10/usr.bin/vtfontcvt/vtfontcvt.c	Mon Apr  9 12:57:08 2018	(r332322)
+++ stable/10/usr.bin/vtfontcvt/vtfontcvt.c	Mon Apr  9 12:58:53 2018	(r332323)
@@ -328,12 +328,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?201804091258.w39Cwr3p014349>