shithub: neatmkfn

Download patch

ref: 793c8584574eb1e92a9c0f4483bcf7d428c0a791
parent: 7c1e51d85563e6726d0eecc3cc149a6e26584975
author: Ali Gholami Rudi <ali@rudi.ir>
date: Tue Mar 27 13:58:47 EDT 2018

mkfn: include fontpath field

--- a/mkfn.c
+++ b/mkfn.c
@@ -120,6 +120,7 @@
 	"  -s      \tspecial font\n"
 	"  -p name \toverride font postscript name\n"
 	"  -t name \tset font troff name\n"
+	"  -f path \tset font path\n"
 	"  -r res  \tset device resolution (720)\n"
 	"  -k kmin \tspecify the minimum amount of kerning (0)\n"
 	"  -b      \tinclude glyph bounding boxes\n"
@@ -147,6 +148,9 @@
 			break;
 		case 'b':
 			bbox = 1;
+			break;
+		case 'f':
+			trfn_pspath(argv[i][2] ? argv[i] + 2 : argv[++i]);
 			break;
 		case 'k':
 			kmin = atoi(argv[i][2] ? argv[i] + 2 : argv[++i]);
--- a/trfn.c
+++ b/trfn.c
@@ -28,6 +28,7 @@
 static char trfn_ligs2[8192];	/* font ligatures, whose length is two */
 static char trfn_trname[256];	/* font troff name */
 static char trfn_psname[256];	/* font ps name */
+static char trfn_path[4096];	/* font path */
 /* character type */
 static int trfn_asc;		/* minimum height of glyphs with ascender */
 static int trfn_desc;		/* minimum depth of glyphs with descender */
@@ -316,6 +317,12 @@
 		strcpy(trfn_psname, name);
 }
 
+void trfn_pspath(char *name)
+{
+	if (!trfn_path[0])
+		strcpy(trfn_path, name);
+}
+
 void trfn_print(void)
 {
 	if (trfn_trname[0])
@@ -322,6 +329,8 @@
 		printf("name %s\n", trfn_trname);
 	if (trfn_psname[0])
 		printf("fontname %s\n", trfn_psname);
+	if (trfn_path[0])
+		printf("fontpath %s\n", trfn_path);
 	printf("spacewidth %d\n", trfn_swid);
 	if (!trfn_noligs)
 		printf("ligatures %s%s0\n", trfn_ligs, trfn_ligs2);