-
Notifications
You must be signed in to change notification settings - Fork 6
Improve gui-metal HiDPI scaling #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
I just change my $font. The whole point of the backend is so that we can use the "physical pixels" instead of the scaled one, because the automatic scaling is terrible to look at. If you want to use the automatic scaled image, can you add it similar to devdraw in plan9port, pressing "cmd-r" would resize the screen and toggle scaling? |
The one in p9p is probably bad analogy, because what you can do with drawterm is only changing the size relying on the window system to scale the low resolution image to your hidpi screen, but not Given rio can't practically keep window at the same size after resizing up/down and back, I don't see any practical use of dynamic toggling of the system scaling. If you really want to work with a low resolution image on your hidpi screen, it's probably easier just to add a command line argument to use the apparent screen point instead of the backing pixels. You could avoid calling all those convert to/from backing functions, because the default sizes are in screen points. I only set font in my profile, as I don't really see anything from the console. |
If you really want to "improve" the low resolution display, as it just occurred to me, you could do a just-in-time 2x upscaling of the image and render it to the display. It would be ugly for rendered freetype fonts, but it would be alright for the original bitmap fonts. In the current code, I have the EPX 2x upscaling for the cursor, drawterm-metal-cocoa/gui-metal/screen.m Lines 218 to 244 in 1776e8a
You could do the same for the whole image, or just use a cheaper nearest neighbor 2x upscaling. This way, we can avoid the uncontrollable upscaling by the macOS window system, and have a sharper image of low resolution plan9 display in the high resolution drawterm. |
For macOS systems with a Retina Display when using a scaled resolution with more space, it seems the
drawterm
resolution scaling isn't ideal resulting very small and hard to read font sizes (see screenshots below)The proposed changes in this PR adjust the
drawterm
screen size according to the system's scaling.