shithub: neatroff

Download patch

ref: eb90d8300b54b89cd1b4551188bcd45263e345e4
parent: c8b2386ccc90cad553c4fd36a7235e95b78f6a7b
author: Ali Gholami Rudi <[email protected]>
date: Thu Apr 13 11:57:25 EDT 2017

font: character aliases are mapped as .fmap

--- a/font.c
+++ b/font.c
@@ -55,7 +55,7 @@
 struct glyph *font_find(struct font *fn, char *name)
 {
 	int i = dict_get(fn->ch_map, name);
-	if (i == -1)
+	if (i < 0)
 		i = dict_get(fn->ch_dict, name);
 	return i >= 0 ? fn->gl + i : NULL;
 }
@@ -314,9 +314,11 @@
 			sscanf(tok, "%hd,%hd,%hd,%hd,%hd", &g->wid,
 				&g->llx, &g->lly, &g->urx, &g->ury);
 		}
+		dict_put(fn->ch_dict, name, *gid);
+		(*n)++;
+	} else {
+		dict_put(fn->ch_map, name, *gid);
 	}
-	dict_put(fn->ch_dict, name, *gid);
-	(*n)++;
 	return 0;
 }