shithub: riscv

Download patch

ref: aec4240c0cddf4ee58cf992102a24f00c477d307
parent: 3a41ce3bf314caad67c2c52a06142f7ac60611c7
author: mischief <mischief@offblast.org>
date: Fri Oct 12 04:34:17 EDT 2018

truetypefs: fall back to width if advance is zero

combining marks will have zero advance, but it results in zero-width
glyphs in subfonts.  fall back to width so something meaningful is
rendered even if its not combined properly.

--- a/sys/src/cmd/truetypefs.c
+++ b/sys/src/cmd/truetypefs.c
@@ -186,7 +186,10 @@
 		*p++ = 0;
 		*p++ = h;
 		*p++ = gs[i]->xminpx;
-		*p++ = gs[i]->advanceWidthpx;
+		if(gs[i]->advanceWidthpx != 0)
+			*p++ = gs[i]->advanceWidthpx;
+		else
+			*p++ = gs[i]->width;
 		x += gs[i]->width;
 	}
 	*p++ = x;