Sublime Forum

Sublime text resetting font size bug

#1

In my user config. file I have the following settings:

ā€œfont_faceā€: ā€œInconsolataā€,
ā€œfont_sizeā€: 12,

If I increase the font using ā€˜ctrlā€™ + ā€˜+ā€™, and then go to preferences -> font -> reset. The font is not reset to ā€œfont_sizeā€, but to a much smaller size. and the setting ā€˜ā€œfont_sizeā€: 12ā€™ is removed from the user config. file (weird).

Does any body know of a custom keybinding/command, which I could use to reset the font size to ā€œfont_sizeā€?

Note: I searched the forum and could not find this issue, apologies If itā€™s already been reported.

0 Likes

#2

If I remember well, reset font **remove **the font_size entry of your config file.
So it means that itā€™s the default size that is used after, which is 10.

Thereā€™s no command to set a specific font size, so you have to do yourself with something like:

import sublime, sublime_plugin class ResetFontSizeCustomCommand(sublime_plugin.ApplicationCommand): def run(self, size): settings = sublime.load_settings('Preferences.sublime-settings') settings.set('font_size', size) sublime.save_settings('Preferences.sublime-settings')
And call it with something like:

run_command('reset_font_size_custom', {'size' : 12})

In addition, you can create you own settings (ā€˜custom_font_sizeā€™) and use it instead of the parameter.

0 Likes

#3

Thanks bizoo, really appreciate the help. I ended up using the custom command as you suggested and it works a treat! :smiley:

0 Likes