shithub: fnt

Download patch

ref: 735525a5b8361b09a6c46986148702f1a72fe4f0
parent: 9377e269215159537789b955e0743755c1bd2cef
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Sep 2 15:35:00 EDT 2024

test: remove non-existent option; more verbose error if drawing failed

--- a/test.h
+++ b/test.h
@@ -3,7 +3,7 @@
 static void
 printusage(Otfile *f)
 {
-	f->print(f->aux, "usage: %s [-i GLYPH_ID | -r RUNE] [-p PPEM  [-g PIXELS] [-m ... -[-H GLYPH_ID]]] font.otf\n", argv0);
+	f->print(f->aux, "usage: %s [-i GLYPH_ID | -r RUNE] [-p PPEM [-m ... -[-H GLYPH_ID]]] font.otf\n", argv0);
 	f->print(f->aux, " -i: operate on a single glyph by its id\n");
 	f->print(f->aux, " -r: operate on a single glyph by its rune\n");
 	f->print(f->aux, " -p: draw (of size in pixels per em) and write the image to stdout\n");
@@ -182,6 +182,7 @@
 			}
 			if(ropts.ppemX > 0 && g->type != GLYPH_EMPTY){
 				if((im[i] = otfdrawglyf(o, g, &ropts)) == nil){
+					werrstr("draw: %r");
 					gind = i;
 					goto glypherr;
 				}
@@ -205,8 +206,10 @@
 			goto glypherr;
 		}else if(ropts.ppemX > 0){
 			GlyfImage *im;
-			if((im = otfdrawglyf(o, g, &ropts)) == nil)
+			if((im = otfdrawglyf(o, g, &ropts)) == nil){
+				werrstr("draw: %r");
 				goto glypherr;
+			}
 			if(out->write != otfdiscard && dumpmap(out, &im, 1) != 0)
 				return -1;
 			free(im);
--