From 940f1fd6af2c144d0db087fefa8478d2a36633d5 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 6 Jan 2023 12:03:22 -0500 Subject: [PATCH] page: scale ppi on high-res displays Also fix wording of -w warning. --- src/cmd/page/page.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cmd/page/page.c b/src/cmd/page/page.c index 01ad17ff..24a4b024 100644 --- a/src/cmd/page/page.c +++ b/src/cmd/page/page.c @@ -96,7 +96,6 @@ threadmain(int argc, char **argv) { Document *doc; Biobuf *b; - char *basename = argv[0]; enum { Ninput = 16 }; uchar buf[Ninput+1]; int readstdin; @@ -134,7 +133,7 @@ threadmain(int argc, char **argv) truetoboundingbox = 1; break; case 'w': - fprint(2, "%s: -w has only the effect of -R X11 systems\n", basename); + fprint(2, "warning: page -w only supported on x11 systems\n"); resizing = 1; break; case 'i': @@ -199,6 +198,13 @@ threadmain(int argc, char **argv) }else b = nil; + if(initdraw(0, 0, "page") < 0){ + fprint(2, "page: initdraw failed: %r\n"); + wexits("initdraw"); + } + display->locking = 1; + ppi = scalesize(display, ppi); + buf[Ninput] = '\0'; if(imagemode) doc = initgfx(nil, 0, nil, nil, 0); @@ -237,12 +243,6 @@ threadmain(int argc, char **argv) if(reverse == -1) /* neither cmdline nor ps reader set it */ reverse = 0; - if(initdraw(0, 0, "page") < 0){ - fprint(2, "page: initdraw failed: %r\n"); - wexits("initdraw"); - } - display->locking = 1; - truecolor = screen->depth > 8; viewer(doc); wexits(0);