- SUBLIME TEXT FONT SIZE 1080P
- SUBLIME TEXT FONT SIZE CODE
- SUBLIME TEXT FONT SIZE MAC
- SUBLIME TEXT FONT SIZE WINDOWS
SUBLIME TEXT FONT SIZE CODE
Meaning, if I open Fira Code and draw em square, it will not align with anything at all: In a digital type, though, an “em square” is (and I’m quoting Wikipedia):Ī grid of arbitrary resolution that is used as the design space of a digital font. Why was the height called “em size”? Because letter “m” was coincidentally a square, and “m” width = character piece height = em size. In traditional metal type, em size is the height of the character piece. This is because font-size sets the so-called “em” size. But these numbers are still nowhere to be seen. So user requesting 32 pt font is actually requesting 32 px on macOS and 43 px on Windows. VS Code seems to take editor.fontSize value directly in pixels. Same font, same pt size, no relative scaling
SUBLIME TEXT FONT SIZE WINDOWS
This holds to this day: 16 pt text on Windows is ⅓ larger than 16 pt text on macOS. So they figured, why not make everything ⅓ larger?Īnd they did, indeed. Why not 72? Not because they had better displays (they didn’t), but because 72 gave you too few pixels to render a legible text. In the spirit of true cooperation, Windows uses 96 PPI instead of 72.
SUBLIME TEXT FONT SIZE MAC
Nice! Of course, Mac displays have improved their PPI since, but the convention stays. If you view text there, its physical size on the screen will match its physical size when printed. Why the number 72? Turns out, original Macs used to have displays with exactly 72 PPI.
SUBLIME TEXT FONT SIZE 1080P
If you put macOS on a 32” monitor and a 24” monitor, both set to 1080p resolution, you’ll get identical pixel size, but not physical size, undermining the original idea. Instead, macOS always uses 72 PPI to convert points to pixels. If I want to see my letters 2 inches tall, I can do that by setting the font size to 144 pt. The idea here was that you set font size directly in physical units, ignoring minute details like screen resolution. Point is a physical unit of measure, equal to 1⁄72 of an inch (0.353 mm), originating from typography. What is going on? Pointsįirst, that size is not in pixels, it’s in points. If we measure letters themselves, number 32 is nowhere to be seen:ģ2 is not the width or height of a letter, neither is it a capital letter height, an x-letter height, an ascender height, a descender height. Sublime.save_settings("Preferences.What happens when you set "font_size": 32 in your favorite editor? I would’ve told you anyway, but I’m glad that you asked. This plugin simply extracts the default font size that you've specified and updates the preferences with it, which will put it back to the value that you want it to be, making the font size change everywhere all at once.Īnother potential solution to this would be the following plugin, which more generally provides a version of the set_setting command referenced above that will set the setting into your global preferences instead of just changing the settings in the current view: import sublimeĬlass GlobalSetSettingCommand(sublime_plugin.ApplicationCommand): Once that's done, you want to edit your default preferences and add a default_font_size setting that specifies the font setting that you want to be your default font size, then modify your key binding above to invoke set_default_font_size instead of reset_font_size. Sublime.save_settings("Preferences.sublime-settings")
New_size = s.get("default_font_size", 10) S = sublime.load_settings("Preferences.sublime-settings") set_default_font_size.py, but only the extension is important): import sublimeĬlass SetDefaultFontSizeCommand(sublime_plugin.ApplicationCommand):
from the menu, then replacing the stub code with the code below and saving it as a python file in the location that Sublime will default to (e.g. To get around that, you need to handle resetting back to the chosen default font size by altering the Preferences.sublime-settings version of the font_size setting.Īn example of that would be the following plugin, which you can use by selecting Tools > Developer > New Plugin. As such you would notice that changing the font size up and down would take effect everywhere, but reseting it would only work in the current view. However, that won't work as you might expect because set_setting modifies the settings only for the currently focused file view, while the Preferences.sublime-settings file specifies the global settings. In particular, increase_font_size and decrease_font_size both modify the current value of the setting, while as you've noticed the reset_font_size command deletes it entirely in order to return things to the default.Īt first blush you might try using the set_setting command instead of reset_font_size, which would allow you to reset the font_size back to the value that want to be the default. The commands increase_font_size, decrease_font_size and reset_font_size are defined in the Default package in the font.py plugin, and they work by directly modifying the value of the font_size setting in Preferences.sublime-settings.