-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Add scaling for themed fonts and graphics (hires displays) #2776
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
Conversation
@ArduinoBot build this please |
1 similar comment
@ArduinoBot build this please |
Build failed. |
The GUI tests fail. Reported error is
You can run the tests with |
I see what's wrong. Using Theme inside Preferences breaks the tests. I've just committed a fix. |
@ArduinoBot build this please |
Looks like a minor change for the about dialog broke this pull request. But of the dozen or so people who've wished for this feature on the forum and another issue, none have bothered to download the build above and provide any feedback... so maybe they don't really care or want this feature much? |
I have tested the http://arduino.cc/download.php?f=/javaide/pull_requests/arduino-PR-2776-BUILD-221-windows.zip I am not sure if I test well but actually, it looks worse with experimental Edit : if need to redo more tests, or give more details about my configuration, just let me know, I would be happy to feedback |
I tested arduino-PR-2776-BUILD-221 on Windows 8.1, 64 Bit 15.6inch UHD Display. Splashscreen on that one is very small (not scaled at all I guess). About-Screen looks fine. |
g.setColor(Color.white); | ||
g.drawString(BaseNoGui.VERSION_NAME, 50, 30); | ||
g.drawString(BaseNoGui.VERSION_NAME, 50 * scale / 100, 30 * scale / 100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PaulStoffregen PR doesn't merge any more because I've changed splashscreen and had to change version string position
When resolving merge, take your version and change
g.drawString(BaseNoGui.VERSION_NAME, 50 * scale / 100, 30 * scale / 100);
to
g.drawString(BaseNoGui.VERSION_NAME, 33 * scale / 100, 20 * scale / 100);
@luc-github When you tested PR-2776-BUILD-221, did you edit lib/theme/theme.txt? From the screenshot you posted, gui.scalePercent appears to still at the default 100 value. This change does NOT cause automatic scaling. You must manually edit lib/theme/theme.txt. This pull request adds the ability for Arduino to scale many things from that single setting. Perhaps someday in the future, when/if Oracle updates Java with the ability to reliably report screen pixel density, this setting might become automatic. But for now, this pull request requires manual editing of theme.txt. |
Ok that the part I missed, sorry, I though it was automatic Thank you |
Thanks for trying again. Good to hear it's mostly working. The splash screen code was added very recently, and unfortunately it doesn't load the image the using the same API as everything else. I'm not sure how much more time I'm going to put into this scaling stuff. At the moment, I don't actually have high-dpi screen. |
The icons look upconverted, because they are upconverted. There's a "TODO" comment in the code where I intend to add the ability to use higher res icons. But 2 things need to happen first: this pull request needs to be merged, and someone would need to actually draw the icons at double size. Long term, I believe everyone understands 150 to 200 dpi screens are the future. That's why I put several hours into the pull request, even though I do not yet personally own such a screen. But with so few people using such screens today, this feature may be a really low priority for the Arduino devs? |
Thanks for this. I'm using the test nightly build today on my Asus UX303L during an Arduino day event. |
Hi - any time frame for implement this ? even graphics are upconverted, it is fine I think, because at least it can be used. |
Very good, set the scalePercent to 180, and the fontsize to 25, and that seems to be good values on my 28" 4K monitor. |
Thanks for working on this! Would it be possible to make the feature not need to manually edit a configuration file? It would be more seamless if the Windows DPI setting was directly read into scalePercent and the UI scaled according to that by default. |
Soon, probably not. As far as I know, nobody is working on this right now. I've been busy lately with a paid project, which hasn't left much time for unpaid open source contributions. Eventually I'll get back to working on Arduino stuff... but my contribution activity happens in cycles and right now is a down time. I can't speak for "the-fallen" (from the forum), but every appearance is he's no longer working on this ether. Unfortunately, this work was done shortly before Arduino 1.6.2, where a tremendous amount of new code the Arduino Team privately developed was added suddenly to the public code base. It broke this pull request. It also added numerous new GUI pieces that don't seem to use the theme system. Windows 10 is due to release in just a couple weeks. Perhaps it will be much the same as 8.1 for scaling, or maybe not? Right now hardly seems like a great time to revisit this work. Eventually, someone will probably pick this up and work on it again. Much more work is needed. Federico and the Arduino Team also really need to decide if they wish to use the theme system or some other approach for new GUI development, and whether they will actually test Arduino on Windows with high res displays. Before 1.6.2 the path seemed clear to use theme.txt. Now the direction is not so clear cut. |
Thanks for the update, Paul. As you mentioned there has been a tremendous amount of functionality added since this build. The Boards Manager especially... |
I'll try to adapt the patches to the latest Source Code. If I can make it I will need somebody to push the code. |
Patches still are working - there are just some lines shifted - everything is fine (latest 1.6.6 Code) |
Here are the patches: |
Thanks for your quick action on this elFallino. I will be happy to test a build generated from these patches. Hopefully it will be rolled in. |
I confirm that the patches are building correctly on the last sources, and setting |
I tested the windows build on my Lenovo Yoga 3 pro and thought a 250% scaling looked great. What's the status of getting it merged back in to the mainline. I tried to build latest locally, but couldn't get past a runtime error. |
I would again adapt the patch to the latest code if one oft the Arduino developers come around and say that they are interested. |
Hey, this patch is wonderful! Could we please release it, already? |
Successfully installed and tested on Yoga 2 Pro (13" monitor with resolution settings at 3200 x 1800 and 250% scaling) running Windows 10. Edited the /lib/theme/theme.txt file scale to 250%. Everything looks great. However, after successfully running the official release (1.64 I think), when I Upload a the Blink sketch example using this build, it tells me that the board is "unofficial". I don't know why this happens now (its an official Arduino Uno board). Please PR this patch ASAP. Screenshot included below (without the error/warning message I mentioned above). |
So I see that this issue has not been completely resolved, but I am just getting started with Arduino, and have a laptop with a 4K screen. I tested the version http://arduino.cc/download.php?f=/javaide/pull_requests/arduino-PR-2776-BUILD-221-windows.zip at 200% and 250% and they both rendered correctly as described above by 5YHgB and luc-github. However, as that test version is only 1.6.2, and the current build is 1.6.6. I saw the patches posted by elFallino above, but have no idea how to use them. Would anyone be able to help me out, as I am a newbie and quite inexperienced with this kind of stuff? |
@HOBI3CAT I converted elFallino's patch into a proper commit, copy this Pastebin paste into a file in the root of the cloned repo and run |
@PaulStoffregen @ffissore I confirm that this patch is still working, I have just tested it with a fresh repo clone and my adapted patchset above (Arch Linux, Dell XPS 13). The only glitch is that you have to resize the window when you first start the IDE, but everything else works fine; see attached screenshots. |
I applied the patch @nmaggioni prepared to current head/1.6.7, and it still works fine on Fedora 23. Would be great to get this released... If anyone wants to test, it's in the 'hidpi' branch of my fork: https://github.com/edovino/Arduino/tree/hidpi |
[LMNTS] |
I assume these patches are only usable with the cloned repo's, is that correct? I use the windows installer and have just bought a yoga 3 14" 2in1 laptop, the Arduino IDE is not only unreadable but the buttons and tabs are way too small for touch, the IDE is totally unusable as it stands on this laptop. |
@pb66 Yes, they are only applicable to the cloned repo's code. See my previous comment for how to apply the most recent patch and this wiki page for instructions on how to build the code. It seems, however, that this issue has been somehow abandoned, even though working patches have been posted repeatedly. |
I still hope those patches will be applied soon. I do not know why there is no feedback yet. |
I'm rebasing these changes on top of master, will open another PR to finalize this patch. |
@nmaggioni, thanks for the response, that is pretty much as I expected. I'm sure the patch would work and involve very little additional work IF already building from source. I had looked at the wiki and at this time I'm just not keen enough to go that route. |
I'm closing this one, please continue the discussion on #4376 |
This pull request adds a "gui.scalePercent" parameter in lib/theme/theme.txt, which can scale most of the currently fixed size graphics and fonts. This allows adjusting Arduino for 4K and other high res screens. It should mostly solve issue #2532 .
Forum user "the-fallen" deserves much of the credit for this patch. He created the original version, posted to the forum. I added automatic font and graphic scaling, and changed it to percentage for finer control.
Discussion is here:
http://forum.arduino.cc/index.php?topic=263838.0