Sublime Forum

Font size not resetting to 10

#1

I am running Sublime Text 3.2.2, build 3211, on Windows 10 x64. Since one of the later builds, the default font size suddenly increased without me doing anything. Of course I executed Preferences » Font » Reset, but it still did not reset the font size to the size I was accustomed to. While trying to investigate this, I noticed something odd is going on.

Here is a screenshot showing the default Preferences and the user Preferences. May be some will notice, that the font size is larger than it should be. On the left you can see, that the default font_size is supposed to be 10, and on the right side you can see, that I did not override this.

Now, weirdly, if I set the font_size in my user Preferences, the font size will change to the size I was originally expecting:

Now I could of course leave it like this, but I would still like to know, why Sublime Text is behaving this way for me. Where else could the default font_size be overridden?

0 Likes

#2

The thing that you’re missing here is the comment that’s associated with the font_size and font_face settings in the Defaults in the left hand portion of the window:

    // Note that the font_face and font_size are overridden in the platform
    // specific settings file, for example, "Preferences (Linux).sublime-settings".
    // Because of this, setting them here will have no effect: you must set them
    // in your User File Preferences.
    "font_face": "",
    "font_size": 10,

That is, although the file on the left includes font_size of 10, that’s not necessarily the font size that’s actually being used because there’s another configuration file that’s applied between the defaults and your customized preferences that modify various OS-specific settings.

In this case, that file is the Default/Preferences (Windows).sublime-settings file (because you’re on Windows). You can use the View Package File command to open that file; it’s contents look like this:

{
    "font_face": "Consolas",
    "font_size": 11
}

Thus, on Windows the default font size is actually 11 and not 10, which is why updating it in your User preferences actually changes the font size to the 10 that you expect.

There’s a similar file for the other OS’s that Sublime supports as well, that do the same thing (as well as changing some other application behaviour related settings as well).

Any setting that appears in one of these OS-Specific default files has a comment in the main configuration file that tells you that this is the case,

More information about all of the places that configuration can come from and the precedence of the settings can be found in this video on Configuring Sublime Text (disclaimer: I’m the video author).

0 Likes

#3

Ah, right. Thank you. But why was it changed to 11 all of a sudden? It used to be 10.

0 Likes

#4

That I couldn’t say. As far as I can tell, the default font size and face on Windows has been Consolas 10 as far back as Sublime Text build 3015.

The command you mentioned above to reset the font size works by wholesale removing the font_size setting from your preferences. It doesn’t reset it back to whatever the default is (removing it does the same thing). So if you previously had a font_size setting in your Preferences and accidentally bumped the file size with the mouse wheel or keyboard item, then resetting it as you did would have removed the setting and possibly made it appear as if you never had set it before, but that’s just a guess.

0 Likes

#5

The new default is pretty annoying. For example, if I want to quickly increase the font size - and then reset it back, it will always of course reset back to the default 11, rather than my 10, since resetting the font size simply removes the setting from the user Preferences, as you pointed out.

0 Likes

#6

The font size was changed in 2017 when we switched to a new internal font rendering system.

0 Likes