Nautilus - How to apply Zoom on the filenames? Not just on the thumbnails

You can try to edit the Nautilus source code to scale the font in the zoom like in Nautilus 3.4.

NOTE: In this example I'm running ubuntu 13.04 with nautilus (files) 3.6.3. You can test this in a virtual machine to see if everything is OK.

First of all, I set the Nautilus Prefereces in "List View" as Default View and "200%" the zoom in List View Defaults.

enter image description here

enter image description here

By default the result with no scale font would be:

enter image description here


1) Make sure you have enable the Source code repository

  • Open the Ubuntu Software Center
  • In the Menu Bar choose Edit -> Software Sources. Click to enable "Source code repository". Just in case I use the "Main Server" to Download.

enter image description here

Open a Terminal window and type:

  • sudo apt-get update

2) In the Terminal type the following to install the necessary packages.

  • sudo apt-get install build-essential quilt

3) Install build dependencies.

  • sudo apt-get build-dep nautilus

4) Create a folder to download the source code.

  • mkdir ~/Downloads/src

  • cd ~/Downloads/src

5) Download the source code & Export variables.

  • apt-get source nautilus

  • export QUILT_PATCHES=debian/patches

  • export EDITOR=gedit

6) Create the patch and Edit the source code.

  • cd nautilus-3.6.3/

  • quilt new my_custom_zoom.patch

  • quilt edit src/nautilus-list-view.c

After line 133 add:

static void   nautilus_list_view_scale_font_size                 (NautilusListView        *view,
                                                                  NautilusZoomLevel  new_level);

enter image description here

After line 2506 add:

static void
nautilus_list_view_scale_font_size (NautilusListView *view, 
                    NautilusZoomLevel new_level)
{
    GList *l;
    static gboolean first_time = TRUE;
    static double pango_scale[7];
    int medium;
    int i;

    g_return_if_fail (new_level >= NAUTILUS_ZOOM_LEVEL_SMALLEST &&
              new_level <= NAUTILUS_ZOOM_LEVEL_LARGEST);

    if (first_time) {
        first_time = FALSE;
        medium = NAUTILUS_ZOOM_LEVEL_SMALLER;
        pango_scale[medium] = PANGO_SCALE_MEDIUM;
        for (i = medium; i > NAUTILUS_ZOOM_LEVEL_SMALLEST; i--) {
            pango_scale[i - 1] = (1 / 1.2) * pango_scale[i];
        }
        for (i = medium; i < NAUTILUS_ZOOM_LEVEL_LARGEST; i++) {
            pango_scale[i + 1] = 1.2 * pango_scale[i];
        }
    }

    g_object_set (G_OBJECT (view->details->file_name_cell),
              "scale", pango_scale[new_level],
              NULL);
    for (l = view->details->cells; l != NULL; l = l->next) {
        g_object_set (G_OBJECT (l->data),
                  "scale", pango_scale[new_level],
                  NULL);
    }
}

enter image description here

After line 2569 add:

/* Scale text. */
nautilus_list_view_scale_font_size (view, new_level);

enter image description here

Remove lines 3051 & 3052.

/* ensure that the zoom level is always set before settings up the tree view columns */
list_view->details->zoom_level = get_default_zoom_level ();

enter image description here

7) Build the deb packages.

  • quilt refresh
  • fakeroot dpkg-buildpackage

8) Install the deb packages.

  • cd ..

  • sudo dpkg -i *deb

9) Finally you can Logout and Login to see the changes.

Result:

enter image description here

NOTE: You can zoom in, zoom out with the Ctrl + Mouse Whell or with Ctrol++ & Ctrol+- keys.

Hope it helps.


You asked to control the zoom behavior specifically in Nautilus, but you also mentioned low-vision accessibility issues, which may indicate a wider application. If you find the zoom factor more useful applied globally, i.e., not just to Nautilus, but to all text on the desktop, you can change it easily in System Settings (gear icon in the upper-right corner of the Unity desktop) ==> Universal Access ==> "Seeing" tab. This will change the size of text globally on the desktop.