shithub: neatroff

Download patch

ref: 08fb351545edb53522414774587b2b951d55f4f6
parent: fd6a3df74c3c63b8e5bd09fc0ea391bbd9b843b3
author: Ali Gholami Rudi <ali@rudi.ir>
date: Tue Jul 18 13:05:32 EDT 2017

font: unmap glyphs with .fmap

If the second argument of .fmap is not a glyph name, the character
specified as the first argument is unmapped.

--- 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 < 0)
+	if (i == -1)		/* -2 means the glyph has been unmapped */
 		i = dict_get(fn->ch_dict, name);
 	return i >= 0 ? fn->gl + i : NULL;
 }