-
-
Notifications
You must be signed in to change notification settings - Fork 998
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
High DPI (hidpi) support #2219
Comments
There's a zooming function too (I use this) with I think "ctrl" + "+", or ctrl + the button where on American layout "+" is. |
HighDPI support sadly isn't as simple as flicking a switch. I've tried some basic implementations, but none have been completely successful. Your best bet right now is to use OS app scaling. |
It may not be as simple as flicking a switch, but a simple "draw everything scaled up" option isn't that difficult. I recently added it to another project, and if I recall correctly it only took me about a day to do it (maybe two). (Mind you, it's probably a bit harder in Wesnoth because it's a larger project, and it also uses SDL rather than SFML which means I'm not as sure how to do it.) |
Any plans to implement this? |
Hi, I just recently started using a 4k monitor, and I'm confirming it's a pain: The screenshots are made on a 3840x2160 resolution, downscaled twice so one can easily see it on a 1080p monitor. On the last picture, you can zoom in the battlefield as @sevu correctly mentions by pressing I wasn't able to find "text scaling" configuration at all. All pictures are from wesnoth-1.14.12. |
If there's any need for HiDPI testing - feel free to ping me, I'll try it out. |
The dpi changes that have been done by @gwhitney so far are on the master branch only, so wouldn't be in 1.14. |
@Pentarctagon on nice! From that information I derive that it's being worked on, and gwhitney even already wrote some changes in the master branch! |
To be clear, I have not worked on comprehensive HiDPI support - certainly nothing like simply drawing everything scaled up by some factor. My efforts so far have been to incrementally make more of the UI text readable on HiDPI displays by scaling the requested text size to the same physical height regardless of the underlying pixel pitch. I have not managed to ferret out all of the different places text sizes are requested (unfortunately they're a bit scattered in the code), nor have I done any work at all on graphical elements (like the sun progressing across the sky) because those are totally outside my experience/skills. Nevertheless, I do feel like it makes a significant improvement to playability on small pixel-pitch screens, especially in combination with the experimental hi-dpi theme I posted at http://forums.wesnoth.org/viewtopic.php?p=654226#p654226 (note that with the recent code changes you do NOT need the message_font_size.lua file). If you are able to install and run from master, vgaming, would be curious to hear how these work for you. |
Was trying to use the theme, but I get this error reported every time the game is started: |
Two possibilities come to mind: Thanks for the report and let me know if either/neither of these ideas helps. (But maybe do it in the forum where the theme file is, not in this issue report.) |
I confirm the problem was the |
Yes, well, the various small-pixel-pitch changes leave things in a state where window sizes are not as tightly controlled/pre-planned as they were when everything was based on one specific resolution. So some of the window dimensions have not caught up with these scaling possibilities, leaving occasionally scroll bars where ideally there would not be. You see above, the preferences screen ended up not quite wide enough for all of its content. Hopefully over time people will track down and iron out remaining issues like this. |
Could anybody explain how to enable HiDPI for the git version? When I select the HiDPI theme, I don't see any changes (the game screen doesn't enlarge). |
I can only comment on the changes I've made: they don't change the size of the game screen. The game screen is resizable, and you can set your display resolution. All of the changes I have made trigger when the pixel dimensions of the game screen are large, and the pixel pitch (i.e., the physical pixel size as reported by SDL) is small. The HiDPI theme linked above enhances those changes by making more text sizes a bit larger in terms of pixels, but again, only if the preconditions are there: a game screen with large pixel dimensions and small pixel pitch. So my advice based on this is to try putting your display at its native resolution mode, resizing the game window to take up as much of the physical display as you like, and if you want to in addition, try installing the HiDPI theme linked above and choosing it, and see how you like the results. Or of course, you can just choose a display mode with fewer pixels in each direction, so larger effective pixels, and run in a regime that doesn't use any of the changes I made. There's actually not all that much difference in the outcome, since nobody (to the best of my knowledge) has redone any or more than just a bit of the artwork to take advantage of say a 4k screen. My main motivation for the changes I made was just to not have to change the display mode for the sake of even being able to read the text in the game, not actually to take advantage of the fine pixel pitch to make the game actually look better. That would take someone with some actual artistic skill and probably quite a bit of time, neither of which I have. Hope these remarks help. |
@gwhitney I tested it with the full screen mode enabled. Now I'm trying to use the window mode, but the HiDPI theme looks exactly the same as the default one (as well as when I ran the game in full screen). My screen resolution is 3840x2160. |
Yes, 3840x2160 is well into the HiDPI regime. Hmm, well, how is the legibility of the text elements of the game, especially all of the stuff in the right sidebar? Are the fonts too tiny? If you can read the information, there's not much else any of these changes would do. If your text is tiny even with the HiDPI theme selected, then something isn't quite right. Not quite sure what to suggest -- you should be able to change various parameters in the HiDPI theme and see the effects. If not, then maybe somehow Wesnoth is not really reading the theme -- although if you can see the theme to select it in the settings dialog, then there shouldn't be any problem reading the theme. Sorry I don't have any more specific advice than to just try to make sure the theme file is being read. Maybe some of the other commenters in this issue have advice to share on getting things to look a bit better in HiDPI. |
Screenshots would help more than trying to describe it, I assume. Posting the build information (see the second bullet point here) might also be useful since it contains the DPI and screen resolution that Wesnoth sees. |
When I start a local game, I get this error in the standard output:
But the theme is listed in the preferences and I can choose between the default and hidpi one. |
Aha, so the theme is not actually being read. On my installation, I have the _main.cfg file in ~/.local/share/wesnoth/1.15/data/add-ons/proto-hi-res -- is that the same for you, and is the directory and file readable (for whatever user id is running the wesnoth app)? Definitely seems to be some problem reading the theme. |
The path on my PC:
Also I copied my wesnoth config to the 1.15 folder with |
Well, it does seem like the files are in the right place... I wish I had another suggestion as to why wesnoth is unable to read the theme. But the error message is definitely indicating that it is not. Maybe someone else more experienced with how themes work with wesnoth could help? Just as a temporary test, not as a long-term solution, you could try replacing the _main.cfg in the default theme with this one (if that makes sense; I think it does, but my understanding of themes is a bit hazy), to see if at least reads OK and if it has positive effects on how your display looks. If it does, then you could return to the question of how to get wesnoth to see it as a theme. Notice that where I posted it, I never packaged it up as a "real" theme or posted it anywhere, and asked for help/advice in doing so, because I don't really understand deeply how themes work and how to make a proper one. I wish I could help more, but I don't really have that experience, and I don't have time at the moment to delve deeply into this. From the discussion, it appears that others have successfully used the theme -- maybe you can reach out to them and try to compare notes on what worked? |
Just installed 1.15.10 and tried it out for hidpi support with the proto-hi-res theme. Got the same message - |
Unfortunately I don't have any more ideas than when renom was reporting the same message last fall. Hopefully someone who understands how themes work better than I do can help/comment. My apologies for not having any direct advice on getting Wesnoth to see this (pseudo-)theme. (As I said, I never was able to connect with someone who could advise me on how to turn "proto-hi-res" into a "real" full-fledged theme, or what all exactly that would mean.) |
This would help me get some of my friends/family with poorer eyesight get into Wesnoth more easily |
There have been a few PRs merged towards this goal recently: |
I tried 1.15.16 and that proto-hi-res theme and nothing changed. The text and buttons are just as small as the default theme. I am on KDE on Linux, 3840x2160 resolution. My KDE is configured to 2x size. |
PR #6629 seems relevant to this issue |
! The linked PR aims at solving many/most problems with HiDPI! Would be good to check that by people who have HiDPI displays. Now's your prime time to help :) (I'm compiling this now as well.) |
High-DPI support via pixel scaling, with full high-dpi fonts and high-res image support, should be functionally complete in master now. The upcoming 1.17.5 dev release should be able to show it off. I've been playing a bit with a 3840x2160 display, and from my testing everything looks great at pixel scales 2 and 3 (equivalent to native 1920x1080 and 1280x720 but with full res fonts and background images). It should also work well on innately high-dpi systems such as Apple's Retina displays. |
Hi @mesilliac, well done. Just tested it out, works fine 👍 |
Closing this as complete. If any issues crop up during or after 1.17.5, they can be considered bugs and new issues should be opened for them. |
Wesnoth is too small to be playable using my laptop's native screen resolution (276 DPI). It would be nice to have the option for pixel doubling or scaling of individual elements.
Currently there is a text-scaling option but it's very buggy (layout not adjusted so lots of clipping occurs), and maxes out at 150% (still small).
The text was updated successfully, but these errors were encountered: