Enable fractional scaling for Ubuntu 18.04

I recently installed Ubuntu 18.04 and discovered that the fractional scaling option that was in 16.04 is no longer there. 200% is too big for my display, and this answer didn't work for me (the options didn't change after running the command).

Is there another way to get fractional scaling?


gsettings set org.gnome.desktop.interface text-scaling-factor 1.2

This command does not change display scaling. It's just a little text-scaling trick for solving the HiDPI problem on Ubuntu. Still looking for the perfect solution.


Install Tweaks by running:

sudo apt install gnome-tweaks

Then go to TweaksFontsScaling Factor and change the scaling value.

Gnome Tweaks font settings

At least this option helps to make text bigger.

Actually I like this approach, since it keeps other things at scaling 1, because I only need the text to be bigger.


XOrg solution

The Archwiki proposes a solution (or rather a hack) with xrandr (if you use standard Ubuntu 18.04 with xorg):

ArchWiki - HiDPI - fractional scaling

Fractional Scaling

A setting of 2, 3, etc., which is all you can do with scaling-factor, may not be ideal for certain HiDPI displays and smaller screens (e.g. small tablets).

xorg

You can achieve any non-integer scale factor by using a combination of GNOME's scaling-factor and xrandr. This combination keeps the TTF fonts properly scaled so that they do not become blurry if using xrandr alone. You specify zoom-in factor with gsettings and zoom-out factor with xrandr.

First scale GNOME up to the minimum size which is too big. Usually "2" is already too big, otherwise try "3" etc. Then start scaling down by setting zoom-out factor with xrandr. First get the relevant output name, the examples below use eDP1. Start e.g. with zoom-out 1.25 times. If the UI is still too big, increase the scale factor; if it's too small decrease the scale factor.

xrandr --output eDP1 --scale 1.25x1.25

Wayland solution

Since Ubuntu 18.04, Wayland is the default display protocol.
To enable scaling:

  • Enable fractional Scaling experimental-feature:

     gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"
    
  • Restart the computer.

  • Open Settings -> Devices -> Displays

  • Now you should see 25 % step scales, like 125 %, 150 %, 175 %. Click on one of them and see if it works.