shithub: neatmkfn

Download patch

ref: 70a9d7e1756ad571871fa815b3f84a9d7392035b
parent: 83e00ddf66299136609660b87fa2f2fc44ed1c62
author: Ali Gholami Rudi <ali@rudi.ir>
date: Mon Aug 4 19:57:58 EDT 2014

otf: use delta even if offset is nonzero in cmap format 4

Reported by Dirk-Wilhelm Peters <peters@schwertfisch.de>.

--- a/otf.c
+++ b/otf.c
@@ -85,8 +85,8 @@
 		offset = U16(offsets, 2 * i);
 		if (offset) {
 			for (j = beg; j <= end; j++)
-				glyph_code[U16(offsets,
-						offset + (j - beg) * 2)] = j;
+				glyph_code[(U16(offsets + 2 * i,
+					offset + (j - beg) * 2) + delta) & 0xffff] = j;
 		} else {
 			for (j = beg; j <= end; j++)
 				glyph_code[(j + delta) & 0xffff] = j;