Author Topic: [Fixed] Minor font / widget issues on 1680x1050 resolution  (Read 3206 times)

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
The shots below were taken on git-master at a 1680x1050 px resolution on git-master.

On the the first image you can see how the in-game console text is cut off to the bottom. The resource values on top of the screen do also overwrite the widgets' bottom. Last but not least, the information on regeneration is cut off (to the right) on the right hand side unit info widget.



The second image shows the "Exit Game" prompt. The 'Cancel' button overlaps the 'OK' button, and the text is pretty large for the size of this window/widget.

« Last Edit: 25 June 2012, 17:51:48 by silnarm »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

macuser

  • Guest
Re: Minor font / widget issues on 1680x1050 resolution
« Reply #1 on: 12 November 2011, 20:01:16 »
Hello,

I have the same problem with a too large text size that does not really seem to fit well in the text boxes.
My resolution is 1280x1024 pixels. Following the Compile Guide for Linux, I checked out via git today and compiled it under Ubuntu 11.10 64bit without any problems.
The glestae version is the following:
Quote
const char * build_date = "Sa 12. Nov 20:23:59 CET 2011";
const char * build_git_sha = "0.3-899-g8054f1a";
Is there anything else I can contribute/ test to amend the problem with the too large text size?

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Minor font / widget issues on 1680x1050 resolution
« Reply #2 on: 13 November 2011, 18:48:01 »
Hi macuser,

  The following function needs modifying,
Code: [Select]
int WidgetConfig::computeFontSize(int size) {
float sz = float(size);
float scale = g_config.getDisplayHeight() / 800.f;
sz *= scale;
if (sz < 10.f) {
sz = 10.f;
}
return int(roundf(sz));
}

Can be found in source/game/widgets/widget_config.cpp @ line 270.

I haven't noticed such problems myself, but I normally run it in a window so I can get at the debugger easier, in any case it seems ok with a window 600-800 px tall, so maybe a "piecewise" function is needed with different scaling should the display be >= 900 or something.

If you can find an appropriate scaling factor, please let us know and someone will make the change in the repo, else you may have to wait for one of us to get around to it, and atm it seems this could take a while ;).
Glest Advanced Engine - Code Monkey

Timeline | Downloads

macuser

  • Guest
Re: Minor font / widget issues on 1680x1050 resolution
« Reply #3 on: 13 November 2011, 19:21:06 »
Hi silarm,

thanks a lot for pointing me directly to the correct file and line and the code quoted, too.
I know some programming, but not which language is used here.
But I guess that the code divides the vertical screen resolution (in my case 1024) by 800 (in my case resulting in 1.28).
What the syntax *= means, I do not know. To me it first looks as if sz gets the value of scale, but that would not make sense, or does it?
Then it checks if sz (in my case sz gets what if scale is 1.28?) is less 10 (.f obviously means that it is a floating point value, right?).
Any sz value below 10 is set to 10. I guess that thus we avoid that text becomes too small, right?
Would we then need an upper limit, too, so that the text does not get too large? (as in my case)
Then I would add e.g. (not tested yet - and as I wrote above, I do not know if this code works at all, but it should):
Code: [Select]
if (sz > 12.f) {
sz = 12.f;
}
The last code line with round surely takes care that sz is always rounded.
Currently, this means that sz is equal or greater than 10 and is always a whole number, i.e. 10, 11, 12, 13, etc.

After modifying the above file and running make again, the text of 12 is fine for my resolution (1280x1024) - but see comment below, too:
Code: [Select]
int WidgetConfig::computeFontSize(int size) {
float sz = float(size);
float scale = g_config.getDisplayHeight() / 800.f;
sz *= scale;
if (sz < 10.f) {
sz = 10.f;
}
// if (sz > 12.f) {
// sz = 12.f;
// }
sz = 11;
return int(roundf(sz));

Comment:
The size is ok regarding readability. But when selecting an item from a drop-down menu, the entry overlaps with the next item value below. In some occasions this may be confusing, because one does not immediately understand (e.g. with terrain renderer) whether the other (below) item (water shader) value belongs to the same drop-down menu or to the next item below. As a solution, the spaces between different items could be enlarged or the font size has still to be made smaller. I set sz even to 10, but when changing terrain renderer, the drop-down menu still hangs down into the next item water shader.

PS 1:
By the way, water shader shows for me (after autoconfig) "???3D_Textures???". Do the question marks have any meaning or is there a misspelling with this variable's value?

PS 2:
I cannot switch to "windowed mode", i.e. the tickbox is always empty, but the games runs fullscreen. When I click on the tickbox, nothing happens, i.e. it does not become ticked and the game still runs in fullscreen mode.
And the resolution field is also always empty, even when I select another resolution. The new resolution works, but the field is still empty.

Should I open a new threads for these two last topics?
« Last Edit: 13 November 2011, 19:48:57 by macuser »

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Minor font / widget issues on 1680x1050 resolution
« Reply #4 on: 13 November 2011, 19:54:56 »
What the syntax *= means, I do not know.
It's a multiplication assignment. So sz *= scale is the same as sz = sz * scale.

PS 1:
By the way, water shader shows for me (after autoconfig) "???3D_Textures???". Do the question marks have any meaning or is there a misspelling with this variable's value?
That means the string is not in the language file. Are you using the default (english) language? If so, we may be missing a string.

PS 2:
I cannot switch to "windowed mode", i.e. the tickbox is always empty, but the games runs fullscreen. When I click on the tickbox, nothing happens, i.e. it does not become ticked and the game still runs in fullscreen mode.
And the resolution field is also always empty, even when I select another resolution. The new resolution works, but the field is still empty.
Hmm, is the new settings screen complete yet, even?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Minor font / widget issues on 1680x1050 resolution
« Reply #5 on: 5 December 2011, 20:43:20 »
Made the dialog boxes size dependant on resolution, seems to work fine for me now, please point out any other widget scaling/sizing problems though :)

I cannot switch to "windowed mode", i.e. the tickbox is always empty, but the games runs fullscreen. When I click on the tickbox, nothing happens, i.e. it does not become ticked and the game still runs in fullscreen mode.
And the resolution field is also always empty, even when I select another resolution. The new resolution works, but the field is still empty.
Hmm, is the new settings screen complete yet, even?

Works for me on WinXP and Win7, I think hailstone had issues though (on Win 7?) and it is definitely not complete for linux, hence the problem in this case, does anyone on windows have problems with switching fullscreen/windowed and/or changing resolution?
Glest Advanced Engine - Code Monkey

Timeline | Downloads

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Minor font / widget issues on 1680x1050 resolution
« Reply #6 on: 3 March 2012, 05:57:48 »
On starting with 800x600 the widgets seem too large and half the drop down button gets cut off. When changing to it in the options menu it's good though. This started to occur when I merged the master changes to the dedicated_server branch.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/