commit db83b54d9945f29f3c07a3f0a5198798885b19e9
parent 4476c296633919d99961f08c44644131375d4c28
Author: Frederic Cambus <fred@statdns.com>
Date: Tue, 28 Jan 2020 19:34:45 +0100
Calculate xlength and ylength from font weight and height.
While there, ensure font weight and height can't be zero.
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/bdftosfd.c b/src/bdftosfd.c
@@ -167,6 +167,12 @@ main(int argc, char *argv[])
if (errstr)
errx(EXIT_FAILURE, "Invalid value for FONTBOUNDINGBOX.");
+ if (!width || !height)
+ errx(EXIT_FAILURE, "Invalid value for FONTBOUNDINGBOX.");
+
+ xlength = 512 / width;
+ ylength = 1024 / height;
+
mask = 1 << (width - 1);
continue;