So I was configuring VS code on my Notebook when suddenly I noticed that my interface font got really small on my desktop, terminal and files.
I use Gnome Tweaks Tool to increase my scaling factor to 1,15 , but, even though it was active, the font stayed tiny.
The solution I found was moving my scaling factor, which instantly fixed my font issue, however, every time I restart my Notebook the font gets tiny again and I have to repeat the process.
I tried reseting my font configuration using this command, but had no success.
gsettings reset org.gnome.desktop.interface text-scaling-factor
I also tried using the command
dconf reset -f /
Finally, I tried using dconf-editor, but still had no success altering the font rendering DPI or changing the scaling factor.
All of the steps I mentioned fixed my fonts temporarily, but the issue still persists when I restart my Notebook
I am out of ideas and even considered getting a fresh Ubuntu install by now...
My video card: NVIDIA GeForce GTX 1050 GPU
Update 2020-10-07
The bug is now fixed, you can get it with
apt
and remove any workaround you had chosen.Original answer
It's a recently introduced bug in Mutter which is the default window manager for Gnome Shell.
https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1892440
It seems to affect mainly Nvidia cards.
It was fixed in Pop!_OS by removing the patch named "x11-Add-support-for-fractional-scaling-using-Randr.patch"
https://github.com/pop-os/pop/issues/1170 https://github.com/pop-os/mutter/commit/a912c7fc25f4797047790fc5df1711eeb31af282
Ubuntu devs did not say how they will resolve this but at least they acknowledged the problem and someone is assigned to it.
The only known workaround for now is what you described: in Gnome Tweaks, change the scaling factor to something else and back to the original value. Unfortunately, as you noted this will be needed after each login and even after each restart of Gnome Shell (ALT+F2, r).
EDIT 2020/10/07
The bug has been fixed in the package
mutter (3.36.6-1ubuntu0.20.04.2)
, available viaapt
.Original answer
Inspired by this answer I implemented a temporary workaround in my machine. I'm currently using Ubuntu 20.04.1 with GNOME Shell 3.36.4.
This does NOT fix the font size in GDM login screen, but only after the login. This trick simply avoids to repeat an annoying sequence of commands after every reboot. Of course this trick may be useful only till the bug in Mutter is fixed.
Create a script (I put it in
~/.local/bin
) with the following content:'1.01' it's just a number to trigger the changes, it may be any value. I decided to use a value very near to the final one. '1.00' is the value that I eventually want. Feel free to put your target value. Same thing for the sleep times, you can change them.
Make it executable running:
Run the script (I named it
fix-font-size.sh
) at boot. For this reason I run Startup Applications Preferences app and created a new item with the following command:Also see the screenshot for reference (where "Modifica programma d'avvio" means "Startup Applications Preferences"):
Save and you should have a correct size font after login without manually inserting commands in the terminal or by GUI.
As mentioned in the bug report:
You can downgrade libmutter package temporarily as a workaround:
Remember to unhold after fix comes out!
Note: Only for PC's having a NVIDIA graphic card.
I installed Ubuntu 20.04 LTS yesterday and faced this exact same problem. This and whenever I close and re-open my laptop lid, the wallpaper gets corrupted, but that's a whole other question. After some messing around I figured out how to solve this issue. All you have to do is change the graphics driver from NVIDIA Binary Driver to X.Org X Server in the Additional Drivers section under Software & Updates (Remember to click Apply Changes, this will take a while). After the changes have been applied, restart your PC. Doing this fixed the issue and the other bug I mentioned above.
Cheers!
The method above is a permanent fix. If you want to use the NVIDIA driver, I think you're gonna have to wait for the developers to release a patch.
I also found this temporary fix (for the bug in question, not the one I mentioned above). You'll have to do this every time you restart. This is if you really wanna keep your NVIDIA driver.
Go to Settings>Universal Access and enable & disable Large Text. That'll show you how Ubuntu is supposed to look.
Cheers Again!!
As this is a bug, as outlined nicely here by stefg-bz, we will have to wait a bit until it is fixed. In the mean time, you can use a workaround, as suggested here by Lorenz Keel, that automatically changes the scaling factor and sets it back when you log in. Here, I provide my implementation of the workaround, which does not require installing additional tools and having a separate script.
1 Create a
.desktop file
in your autostart folder.2 Paste the following contents in the text file
Adapt the contents on the
Exec=
line to your needs.1.2
inorg.gnome.desktop.interface text-scaling-factor 1.2
to the font scaling factor you use yourself.1
insleep 1
to a higher value if the setting is not (always) applied correctly after login.sleep 1
provides a delay of 1 second before thegsettings
command kicks in. For example,1.5
would make the delay 1.5 seconds.3 Save the file and close the editor
So I've seen you folks trying hacky ways to make it work, but the one solution I found that proven to work well "making it permanent" is this
Install Gnome Tweak tools
look for installed app
"Tweaks"
In tweaks go to
Fonts > Scaling factor
.. set it to1.0
or whatever you like.Reboot .. this should make that change permanent
I recently upgraded from 18.04 LTS to 20.04 LTS and had the same issue. I am using a Nvidia 2080 Ti with a 4k 42" TV. The text was too small and title bars was the same way. I fixed my issue by changing the display scale settings from 100% to 200%. You can find this under settings/display. This fixed my issue. I restart the computer too to make sure the settings saved and they do. Hope you resolve your issue.
After upgrading 20.04 yesterday, I had the problem of fonts staying too large, not too small, but I have a 4k monitor and tweak my fonts differently.
What worked for me (and what survives reboot) was to turn on Fractional Scaling in settings and use a 125% scaling. I also turned off Large Text in Accessibility and set Gnome Tweaks Font Scaling to 1.0. I don't know if that is mandatory but it works for me as I previously was using Font Scaling of 1.25. The bottom line is that Fractional Scaling now works for me on my nVidia GeForce GTX Titan X, whereas previously it didn't. Is this a fix in the recent upgrade? I have no idea.
Similar problem here that seemed to appear in one of the updates in the past week or so. UI text (clock, window titles) and menu bar upper tray icons are too large initially, when using an Nvidia card with a 4K monitor (this is a laptop and the problem does not occur if the monitor is disconnected). My workaround is what someone mentioned above where I have to flip the accessibility setting "Large text" on and then back off to get the text back to normal. We'll probably see a fix in about two years, knowing Ubuntu, but fortunately the workaround is easy.
This is because your NVIDIA Driver go to software & updates, Tab Additional Drivers and change it to X.org this solve my problem and wait for a patch from Nvidia