shithub: neatmkfn

Download patch

ref: 613f6fac8dcb4139d3330bcf84f0320305763bc3
parent: 0209ff9b1eace714f78b55e8bf6cc1379d2fa7c4
author: Ali Gholami Rudi <ali@rudi.ir>
date: Fri Mar 30 21:03:50 EDT 2018

trfn: support 72000 resolution

--- a/otf.c
+++ b/otf.c
@@ -49,8 +49,8 @@
 
 static int uwid(int w)
 {
-	int d = 7200 / res;
-	return (w < 0 ? owid(w) - d / 2 : owid(w) + d / 2) / d;
+	int d = 72000 / res;
+	return (w < 0 ? owid(w) - d / 20 : owid(w) + d / 20) * 10 / d;
 }
 
 /* weather the script is right-to-left */
--- a/trfn.c
+++ b/trfn.c
@@ -8,7 +8,7 @@
 #include "trfn_agl.h"
 #include "trfn_ch.h"
 
-#define WX(w)		(((w) < 0 ? (w) - trfn_div / 2 : (w) + trfn_div / 2) / trfn_div)
+#define WX(w)		(((w) < 0 ? (w) - trfn_div / 20 : (w) + trfn_div / 20) * (long) 10 / trfn_div)
 #define LEN(a)		((sizeof(a) / sizeof((a)[0])))
 #define HEXDIGS		"0123456789ABCDEF"
 #define NCHAR		8	/* number of characters per glyph */
@@ -17,7 +17,7 @@
 
 static struct sbuf *sbuf_char;	/* characters */
 static struct sbuf *sbuf_kern;	/* kerning pairs */
-static int trfn_div;		/* divisor of widths */
+static int trfn_div;		/* divisor of widths x 10 */
 static int trfn_swid;		/* space width */
 static int trfn_special;	/* special flag */
 static int trfn_kmin;		/* minimum kerning value */
@@ -343,7 +343,7 @@
 void trfn_init(int res, int spc, int kmin, int bbox, int ligs, int pos)
 {
 	int i;
-	trfn_div = 7200 / res;
+	trfn_div = 72000 / res;
 	trfn_special = spc;
 	trfn_kmin = kmin;
 	trfn_bbox = bbox;