flightlessmango / MangoHud

A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more. Discord: https://discordapp.com/invite/Gj5YmBb
MIT License
6.33k stars 278 forks source link

no_smaller_font making Resolution text overlap resolution value #1219

Open luisalvarado opened 7 months ago

luisalvarado commented 7 months ago

This is for 0.7.1 on Ubuntu 23.10

When using the following:

MANGOHUD_CONFIG=output_folder=/home/luis/mangohud-logs,horizontal,horizontal_stretch,font_size=52,gpu_name,resolution,fps_metrics=0.001+0.01+0.97+avg,histogram,no_small_font gamemoderun mangohud %command%

image

I am trying to make the whole thing fit in a 4K monitor which still has space. Was originally trying to make the histogram graph longer but I was not able to find a parameter to adjust the width of it. or even the unit of time used for it to show more "time" within it.

Just in case, it is only that container for the resolution affected, since when I remove other elements like the GPU Name, it still happens like so:

image

luisalvarado commented 7 months ago

So all I managed to do is, inside the hud_elements.cpp file, on line 883 inside the void HudElements::resolution()

I changed the 1.3 multiplier to 2.4 (2.6 makes more sense but for some reason adds too much space between the word Resolution and the value compared to other values in the HUD.

I tried to look for a simpler way of doing something like, If the user no_small_font then use 2.4x for 4K resolutions or even taking into account the font size, or else use the default 1.3 but could not find something as easy as:

if (params->no_small_font)

Note that this was tested only on 4K. Did not test in other resolutions. If I leave it without the no_small_font then it separates too much from the word resolution. I also tried to look for a way to reset the stats, this is useful for cases where the intro of the game, the loading of the game or anything else in the game you did not want to record so it does not mess up the real stats. For example, by loading RDR2 you end on the main menu which captures FPS information that was not needed for the actual stats in-game, same for the loading.

Maybe another alternative is to hide the word RESOLUTION (like a parameter that hides it as an option).

Sorry I did not push a PR about this but:

  1. The code I provided sucks. There is no testing for multiple resolutions.
  2. No IF statement conditional check for the parameter being used
  3. No check for font size adjustments
  4. It affects the FPS text for the fps metrics as seen on the image. Now the value and the word FPS merged together. Looks bad.

So currently it is just an opinion in the wind.

image

rharish101 commented 1 month ago

Can you re-open this issue? It still affects me in the latest version (0.7.2).

luisalvarado commented 1 month ago

Can you post the mangohud settings you are using (the mangohud.conf file), version of your distro and how are you testing it.

rharish101 commented 1 month ago

Sure, here are the details:

I simply enable the resolution and the no_small_font config options. Then if you open any game with MangoHud, then you should see the same issue as shown in the screenshots in the top post.

luisalvarado commented 4 weeks ago

So all I managed to do is, inside the hud_elements.cpp file, on line 883 inside the void HudElements::resolution()

I changed the 1.3 multiplier to 2.4 (2.6 makes more sense but for some reason adds too much space between the word Resolution and the value compared to other values in the HUD.

I tried to look for a simpler way of doing something like, If the user no_small_font then use 2.4x for 4K resolutions or even taking into account the font size, or else use the default 1.3 but could not find something as easy as:

if (params->no_small_font)

Note that this was tested only on 4K. Did not test in other resolutions. If I leave it without the no_small_font then it separates too much from the word resolution. I also tried to look for a way to reset the stats, this is useful for cases where the intro of the game, the loading of the game or anything else in the game you did not want to record so it does not mess up the real stats. For example, by loading RDR2 you end on the main menu which captures FPS information that was not needed for the actual stats in-game, same for the loading.

Maybe another alternative is to hide the word RESOLUTION (like a parameter that hides it as an option).

Sorry I did not push a PR about this but:

  1. The code I provided sucks. There is no testing for multiple resolutions.
  2. No IF statement conditional check for the parameter being used
  3. No check for font size adjustments
  4. It affects the FPS text for the fps metrics as seen on the image. Now the value and the word FPS merged together. Looks bad.

So currently it is just an opinion in the wind.

image

@flightlessmango Hi, looks like this is happening on 0.7.2, just tested too. The overlapping of text.