shithub: neatpost

Download patch

ref: b274b7392d6424909b93e48788568f9282eac87f
parent: 1d4c0e6324ea5e0f8baf9ee591582d41ab24e587
author: Ali Gholami Rudi <ali@rudi.ir>
date: Wed Apr 4 12:48:23 EDT 2018

font: store every glyph described in the font descriptor

This is necessary for selecting glyphs based on their CIDs in the PDF
post-processor.

--- a/font.c
+++ b/font.c
@@ -75,15 +75,12 @@
 	if (strcmp("\"", tok)) {
 		if (fscanf(fin, "%d %s", &type, id) != 2)
 			return 1;
-		*gid = dict_get(fn->gl_dict, id);
-		if (*gid < 0) {
-			*gid = font_glyphput(fn, id, name, type);
-			g = &fn->gl[*gid];
-			sscanf(tok, "%d", &g->wid);
-			tilleol(fin, tok);
-			if (sscanf(tok, "%d", &g->pos) != 1)
-				g->pos = 0;
-		}
+		*gid = font_glyphput(fn, id, name, type);
+		g = &fn->gl[*gid];
+		sscanf(tok, "%d", &g->wid);
+		tilleol(fin, tok);
+		if (sscanf(tok, "%d", &g->pos) != 1)
+			g->pos = 0;
 		dict_put(fn->ch_dict, name, *gid);
 		(*n)++;
 	} else {