shithub: neatmkfn

Download patch

ref: 389b96d68669a44851fb55a4a6969244ac8aed34
parent: b5b50ca96716f7df026bff329f405c7431dccdbe
author: Ali Gholami Rudi <ali@rudi.ir>
date: Sun Sep 8 12:38:02 EDT 2013

trfn: print special line with -s

--- a/mktrfn.c
+++ b/mktrfn.c
@@ -87,6 +87,7 @@
 	int afm = 0;
 	int i = 1;
 	int res = 720;
+	int spc = 0;
 	for (i = 1; i < argc && argv[i][0] == '-'; i++) {
 		switch (argv[i][1]) {
 		case 'a':
@@ -98,6 +99,9 @@
 		case 'r':
 			res = atoi(argv[i][2] ? argv[i] + 2 : argv[++i]);
 			break;
+		case 's':
+			spc = 1;
+			break;
 		case 't':
 			trfn_trfont(argv[i][2] ? argv[i] + 2 : argv[++i]);
 			break;
@@ -109,7 +113,7 @@
 			return 0;
 		}
 	}
-	trfn_init(res);
+	trfn_init(res, spc);
 	if (afm)
 		afm_read();
 	else
--- a/trfn.c
+++ b/trfn.c
@@ -17,6 +17,7 @@
 static struct sbuf sbuf_kern;	/* kernpairs section */
 static int trfn_div;		/* divisor of widths */
 static int trfn_swid;		/* space width */
+static int trfn_special;	/* special flag */
 static char trfn_ligs[1024];	/* font ligatures */
 static char trfn_trname[256];	/* font troff name */
 static char trfn_psname[256];	/* font ps name */
@@ -230,6 +231,8 @@
 		printf("fontname %s\n", trfn_psname);
 	printf("spacewidth %d\n", trfn_swid);
 	printf("ligatures %s 0\n", trfn_ligs);
+	if (trfn_special)
+		printf("special\n");
 	printf("charset\n");
 	printf("%s", sbuf_buf(&sbuf_char));
 	printf("kernpairs\n");
@@ -236,10 +239,11 @@
 	printf("%s", sbuf_buf(&sbuf_kern));
 }
 
-void trfn_init(int res)
+void trfn_init(int res, int spc)
 {
 	int i;
 	trfn_div = 7200 / res;
+	trfn_special = spc;
 	agl_read("glyphlist.txt");
 	sbuf_init(&sbuf_char);
 	sbuf_init(&sbuf_kern);
--- a/trfn.h
+++ b/trfn.h
@@ -1,4 +1,4 @@
-void trfn_init(int res);
+void trfn_init(int res, int special);
 void trfn_done(void);
 void trfn_trfont(char *name);
 void trfn_psfont(char *fontname);