51

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

1
  • 1
    Even in lock screen the text appears to be scaled abnormally Sep 1, 2020 at 9:26

12 Answers 12

36

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).

8
  • Switching from NVIDIA binary driver to X.Org X Server driver and rebooting as suggested in Sujit's answer here worked for me. I prefer it over the other workarounds because there's no need to reapply it or write a script. Aug 24, 2020 at 8:49
  • 3
    Keep in mind that switching from Nvidia to Nouveau driver can have much more impact on your system. For example, no Vulkan support in Nouveau, many Steam games will be much slower or plainly not work. In general, performance and compatibility with current graphic cards generation is still a problem. To me it is not worth the trade-off compared to a 4 lines script running automatically on each login without any impact on the system.
    – stefg-bz
    Aug 24, 2020 at 11:50
  • I see something similar with an Intel video card, although only affecting the Shell itself. Changing scaling and then back returns display to normal
    – vanadium
    Aug 24, 2020 at 19:26
  • 2
    There is workaround for this bug: downgrade buggy packages sudo apt install libmutter-6-0=3.36.1-3ubuntu3 gir1.2-mutter-6=3.36.1-3ubuntu3 and hold current versions sudo apt-mark hold libmutter-6-0. Don't forget to subscribe on launchpad issue to unhold package when fix comes up. Sep 10, 2020 at 18:36
  • I use this "large text" trick superuser.com/a/869720/157532 Oct 6, 2020 at 0:00
28

EDIT 2020/10/07

The bug has been fixed in the package mutter (3.36.6-1ubuntu0.20.04.2), available via apt.

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.

  1. Create a script (I put it in ~/.local/bin) with the following content:

    sleep 5s
    gsettings set org.gnome.desktop.interface text-scaling-factor 1.01
    sleep 0.5s
    gsettings set org.gnome.desktop.interface text-scaling-factor 1.00
    

    '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.

  2. Make it executable running:

    chmod +x ~/.local/bin/fix-font-size.sh
    
  3. 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:

    bash -c "/home/username/.local/bin/fix-font-size.sh"
    

    Also see the screenshot for reference (where "Modifica programma d'avvio" means "Startup Applications Preferences"):

    add command to startup applications

  4. Save and you should have a correct size font after login without manually inserting commands in the terminal or by GUI.

2
  • 4
    For our English readers, "modifica programma d'avvo" is Ubuntu's built-in Startup Applications Preferences app.
    – TIER 0011
    Sep 1, 2020 at 11:05
  • 1
    Though the bug is supposedly fixed, I still see this problem. Every time I reboot, the font reverts to smaller than 1. I have to turn off/ turn on "Large Text." To do that, I squint and sort of guess at where the Universal Access icon is in my title bar. Using the scrpt per your instructions, it works like a charm. Thank you! BTW - in case anyone else is wondering, the "Large Text" setting in Universal Access appears to be a scaling factor of 1.25. So in my script, I am setting factor to 1.00, then back to 1.25 (the equivalent of turning off large text, then turning it back on again).
    – LSharkey
    Feb 9, 2021 at 18:58
12

As mentioned in the bug report:

You can downgrade libmutter package temporarily as a workaround:

sudo apt install libmutter-6-0=3.36.1-3ubuntu3 gir1.2-mutter-6=3.36.1-3ubuntu3
sudo apt-mark hold libmutter-6-0

Remember to unhold after fix comes out!

3
  • How to unhold ?
    – IvanP
    Aug 27, 2020 at 20:27
  • I think it is the best and easiest option until fix comes out! Thanks!
    – wensiso
    Sep 2, 2020 at 7:20
  • @IvanP You can use sudo apt-mark unhold libmutter-6-0 Sep 5, 2020 at 0:16
5

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.

enter image description here

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.

enter image description here

Cheers Again!!

6
  • 1
    Switching from NVIDIA binary driver to the X.Org X Server driver then rebooting fixed the problem for me. Aug 24, 2020 at 8:44
  • 1
    @BrandonMiller glad I could help :)
    – Sujit
    Aug 24, 2020 at 13:20
  • Not the solution if you use an Intel graphics card (and yes, it affects me to). Best workaround: a startup script as indicated in the answer by Lorenz Keel
    – vanadium
    Aug 24, 2020 at 19:46
  • @vanadium, I see... thanks for letting me know
    – Sujit
    Aug 25, 2020 at 6:53
  • Changing the graphics card driver is definitely not the solution, as it can have way more impact on the system than the bug itself. Besides, people who bought a (expensive) specific graphics card and installed the official driver did it for some reason and removing the whole device functionality due to some fonts bug in the desktop manager is not acceptable at all. Sep 14, 2020 at 8:57
5

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.

gedit ~/.config/autostart/workaround_font_scaling.desktop

2 Paste the following contents in the text file

[Desktop Entry]
Exec=/usr/bin/sh -c "sleep 1 && gsettings reset org.gnome.desktop.interface text-scaling-factor && gsettings set org.gnome.desktop.interface text-scaling-factor 1.2" 
Name=Fontissue
StartupNotify=false
Type=Application

Adapt the contents on the Exec= line to your needs.

  • Change 1.2 in org.gnome.desktop.interface text-scaling-factor 1.2 to the font scaling factor you use yourself.
  • Change 1 in sleep 1 to a higher value if the setting is not (always) applied correctly after login. sleep 1 provides a delay of 1 second before the gsettings command kicks in. For example, 1.5 would make the delay 1.5 seconds.

3 Save the file and close the editor

1

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

sudo add-apt-repository universe

sudo apt install gnome-tweak-tool

look for installed app "Tweaks"

In tweaks go to Fonts > Scaling factor .. set it to 1.0 or whatever you like.

Reboot .. this should make that change permanent

1
  • 2
    I'm already using the tweak tool, but the problem comes back again restart :( Sep 1, 2020 at 9:29
0

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.

1
  • Unfortunately 200% makes everything too big on my 1080p display, but thanks for the suggestion Aug 22, 2020 at 15:20
0

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.

1
  • Fractional scaling doesn’t work for me, it glitches my screen and turns everything barely readable unfortunately Aug 22, 2020 at 20:02
0

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.

0

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

0

Just to add to the ways to temporally fix this problem, you can turn large text on and off in the accessibility pull down and this will solve the problem until next restart.

0

If you don't want to use a discrete Nvidia card on Linux then you may use an integrated Intel one (aka APU if your processor supports graphics) to avoid display and text scaling problems with installed Nvidia driver. The following commands may do a trick for you:

$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt update
$ sudo ubuntu-drivers autoinstall
# if any errors occurs you may try to use the following command
# it's the latest open-source, long-term driver version for the current moment
$ sudo apt install nvidia-driver-455 # if no errors on the above command - skip
$ sudo prime-select intel
$ sudo reboot

So on the restart of the system it should work as expected and when you type in the terminal sudo prime-select query it will show that Intel profile is used.

Last but not least, Ubuntu 18.04 doesn't suffer from text scaling issues with Nvidia cards (at least Nvidia RTX 2060 mobile & GTX 1660 Ti mobile work perfectly) but do from display scaling.

2
  • I don't have an integrated intel gpu... Only geforce 1080. This solution does not apply to most desktop.
    – francogp
    Oct 4, 2020 at 21:55
  • @francogp yes, indeed. I mentioned it above to avoid confusion, thanks. Oct 5, 2020 at 13:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .