Fontsize and dpi scaling
-
Java applications take into account the system dpi scaling setting.
On my display, with Substance look and feel, with 125% dpi scaling, the text looks OK, but the images get upscaled 25% which makes them blurry.
It's possible to disable this with a command line option -Dsun.java2d.uiScale=1.0 (can also be set by code).
The problem now becomes that the Substance text is tiny.
It's possible to overrride the look and feel properties through code, but it seems you need to do this for each GUI element (button, label, etc.)
Having an option to make the GUI text larger would be nice. -
@butterw the subject of HDPI has come up before but i think it is not currently on the roadmap.
-
@butterw
I could be wrong, but I would guess that most players will be unaffected by this, as they just take the default Windows 100% dpi scaling.Is there a Windows option to run just TripleA with100% scaling and the rest of your Computer at 125%.
-
@ubernaut
The scaling happens by default, it's really about disabling it. I don't think there is a simple solution that works in all cases (all platforms, all look and feels, + can be changed dynamically) , but there might be some useful hacks out there.
I suspect many players would prefer smaller text for a more compact layout, but the text still has to be readable. -
@thedog
The issue is that the text is too small here with 100% scaling with Substance for me. It will depend on screensize and possibly other system parameters.
Disabling scaling in the icon properties compatibility setting may also work, but I can't confirm it. With command-line you can put the value you like ex: 1.10 independantly of Windows. -
@butterw
This might not be suitable, but just in case;
Right click on the Desktop shortcut for TripleA
Properties
Compatibility Tab
Change high DPI settings
Here might be a few options worth trying. -
@butterw said in Fontsize and dpi scaling:
Java applications take into account the system dpi scaling setting.
And that is a very bad thing. Enlarging TripleA maps is visually degrading and easily very bad (blurry) looking.
By the way, this did not happen when I used to download the "all platforms", so I suspect it being related to the installer rather than the program itself.
-
@cernel This feature was added to Java a couple years back, so this affects all java programs with a GUI.
The issue will not be obvious to new users, as all apps on Windows now typically handle high dpi.
One solution could be to have a setting in Triplea to scale down the displayed graphical elements (in addition to the map and the units on it, which can already be scaled).
-
@butterw usually you could just take the system setting i think that's what most apps do
-
@ubernaut Windows System setting (above 100%) kinda works, at least in the main maps. But images (displayed at 125%) are blurry/ugly.
-
@butterw my understanding is that the code needs to be updated and that there needs to be an assumption of a certain version of java for this to work.
-
@ubernaut Older versions of the program likely didn't do this.
But current java version in v2.5/2.6 is java11. On Windows, the required Java Runtime is bundled with Triplea, so by default it affects anyone using at least these versions.
-
@butterw Most users will never figure out anything of this. If they have any scaling setting, they'll just get badly looking blurred TripleA maps and simply think that TripleA maps are that bad.
If it is feasible, the program should always enforce a pixel-per-pixel rendering as default (assuming vectorial graphic will never be supported).
-
@cernel said in Fontsize and dpi scaling:
@butterw Most users will never figure out anything of this. If they have any scaling setting, they'll just get badly looking blurred TripleA maps and simply think that TripleA maps are that bad.
If it is feasible, the program should always enforce a pixel-per-pixel rendering as default (assuming vectorial graphic will never be supported).
Disabling the default dpi scaling is possible, the issue is that it will lead to small text.
In this Substance statusbar example, I've overriden system dpi in code to avoid the blurry image scaling and I've increased the Font size of Labels. The original font size can be seen on the titles.
-
@butterw said in Fontsize and dpi scaling:
@cernel said in Fontsize and dpi scaling:
@butterw Most users will never figure out anything of this. If they have any scaling setting, they'll just get badly looking blurred TripleA maps and simply think that TripleA maps are that bad.
If it is feasible, the program should always enforce a pixel-per-pixel rendering as default (assuming vectorial graphic will never be supported).
Disabling the default dpi scaling is possible,
I strongly suggest it to be done, then.
the issue is that it will lead to small text.
Nowhere as much as a problem as bad looking (blurry) graphic. By the way, I believe the default units stack numbers size (12) is way too small. The other problem is that it is not map-customizable. I keep it at 24 in my "270BC Wars" game and I would like to be able to set at this value as default for everyone.
Also, it would be good to be able to zoom in and out the game notes. In my "270BC Wars" I set the text size of the game notes much bigger than the default (almost every other game uses).
-
The problem is actually acute the most for cursors (I mean the maps each featuring a cursor image, like "Civil War"). Since I believe currently only "GIF" is supported for cursor images, rendering it non pixel-per-pixel gives very bad results there.
Try to open a map featuring a cursor image while having a higher than 100% scaling setting: the cursor will look very badly drawn.
In this case, there is also the problem that if you have set the cursor focus somewhere else than the default coordinates (double zero), the cursor image is scaled but not the focal point, which thereby goes out of place with respect to the drawing of the image (for example, if you have a cursor image in the shape of a sight).
-
@cernel It's quite obvious that dpi scaling needs to be turned off for some maps, even if it means small text. For maps such as ww2_v it is less critical, though the issue is still present. You are correct when stating that players who use high dpi will just think the map (or triplea) is buggy.
I don't think there is a solution that will work across all OS/Look&Feels (other than providing an option to disable dpi scaling). Players need to be aware that turning off dpi scaling can help.
the Font size for Unit counts could be bigger.
I don't know what the plan is for notes in v2.6, but the Notes tab has been removed. Using a web browser to view the now separate .notes.html file would probably be the best option. At least the notes are now guaranteed to be readable. Notes file can be designed so that they will display better in game and the in game display could be improved.
-
@butterw
For Notes, another alternative that works in 2.6 in my 3 maps I use a Game_Notes.png image that is called by the xml. -
FWIW, the notes are still available from the menu bar. Whether as an image or HTML, it is encouraged that the notes contents be extracted to a notes file. Hopefully it's obvious why having a notes file is nicer than inling HTML into XML.
-
Addendum, I'm not sure if 2.6 will even read notes from the XML file, so yeah, best to extract them : )