page: scale ppi on high-res displays

Also fix wording of -w warning.
This commit is contained in:
Russ Cox 2023-01-06 12:03:22 -05:00
parent ffbdd1aa20
commit 940f1fd6af

View file

@ -96,7 +96,6 @@ threadmain(int argc, char **argv)
{ {
Document *doc; Document *doc;
Biobuf *b; Biobuf *b;
char *basename = argv[0];
enum { Ninput = 16 }; enum { Ninput = 16 };
uchar buf[Ninput+1]; uchar buf[Ninput+1];
int readstdin; int readstdin;
@ -134,7 +133,7 @@ threadmain(int argc, char **argv)
truetoboundingbox = 1; truetoboundingbox = 1;
break; break;
case 'w': 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; resizing = 1;
break; break;
case 'i': case 'i':
@ -199,6 +198,13 @@ threadmain(int argc, char **argv)
}else }else
b = nil; 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'; buf[Ninput] = '\0';
if(imagemode) if(imagemode)
doc = initgfx(nil, 0, nil, nil, 0); 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 */ if(reverse == -1) /* neither cmdline nor ps reader set it */
reverse = 0; reverse = 0;
if(initdraw(0, 0, "page") < 0){
fprint(2, "page: initdraw failed: %r\n");
wexits("initdraw");
}
display->locking = 1;
truecolor = screen->depth > 8; truecolor = screen->depth > 8;
viewer(doc); viewer(doc);
wexits(0); wexits(0);