Open willthong opened 10 years ago
Does this apply to all proportional fonts or just specific ones you tried? Can you name examples?
Proportional font faces I've tried:
Monospace fonts it works for:
Can confirm with all your fonts and a few more,
Same here. Font Lucida Console can't be displayed italic and bold either OS: Windows 7 Version: ST3
This is broken even if you use a proportional-width programming font. I just started using the Input font family in Sublime (Input Sans Narrow, to be specific) and can't apply any font styles.
What is the motivation behind this restriction? I can't imagine it's a technical limitation. Can the status of this issue be elevated?
I've recently discovered Input as well and wanted to use the proportional version (Input Serif or Input Sans) instead of the current monospaced font I'm using. However, to my surprise, ST wouldn't allow any italics or bold styles.
Since @willthong mentions "in the theme for a monospace font" is there something I can tweak in the theme to make it think the proportional font I'm using is mono? But anyway would really love for this bug in my favorite text editor to be resolved.
OS X 10.11.3 ST3 build 3103
I just saw this discussion. Sounds like it will not be fixed.
@reagle, I'm positive this is not the page you wanted to reference.
Sorry, here's the correct link and I corrected it above https://forum.sublimetext.com/t/proportional-fonts-lose-italic-bold-syntax-highlighting/10245/10
Marking this as an enhancement request, since we are purposefully not enabling italic and bold when a font is not monospace.
Why are you purposefully not enabling italic and bold? This would be very useful for me
The current implementation was written the way it was because enabling proportional bold and italics that are not the same width as the normal font can cause cause reflow. That is, the bold and italic characters are different widths. Since formatting is dynamic when typing code (a syntax definition pattern can result in a character being typed changing the style of a word a couple or words back. If that word changes to bold, the increased width can cause the word your cursor is on to wrap to the next line. This is feels odd when typing.
@wbond 1) not weird at all, that's exactly what I expect to happen- just like I expect a reflow when I increase width by typing more letters :) 2) that's a trivial price to pay for the awesomeness of being able to use such fonts 3) Also, you could instead temporary increase the wrap width limit to avoid this weirdness (e.g. bold text would reflow after a delay / after you leave the line / after you stop editing or something)
@wbond I do understand your concern but I agree with @eugenesvk, and I think that given that the change is directly caused by a user action it is surely not very confusing. Perhaps this could at least be an option?
I looked into this recently and wanted to add some more info. Differing widths between the normal, bold and italic versions of a glyph does not cause reflow, but instead causes cursor positions and glyph positioning to be all incorrect.
The current implementation doesn't do per-style glyph layout. Instead, layout is stored per glyph, so it isn't a case of just turning this on. Instead, the glyph layout algorithm/drawing will need to be rewritten to allow this to be possible.
I'm just chiming in that I would be interested in complete styling support for proportional typefaces. I would prefer to use a proportional typeface for writing syntaxes (Markdown, Taskpaper) and Fira Code for everything else, both with ligatures.
I was trying to turn Sublime Text into prose editor recently, inspired by iA Writer.
The only thing I wasn’t able to reproduce was Duospace font. It’s almost a monospaced font with only w
and m
taking 1.5× width. The rationale is here https://ia.net/topics/in-search-of-the-perfect-writing-font.
I found it a great option for writing, but as I enable it, I lose the ability to see bold/italics, which occur in markdown a lot :(
Quesion: iA Writer Duo S has consistent char widths between Regular-Bold-Italic. Can we have an (maybe hidden) option to enable non-monospaced font styles, at least if I can guarantee the bold/italic/regular has the same width?
The fonts are available for free here https://github.com/iaolo/iA-Fonts/tree/master/iA%20Writer%20Duo/Static
Came here to vote after reading your guide.
The current implementation doesn't do per-style glyph layout. Instead, layout is stored per glyph, so it isn't a case of just turning this on. Instead, the glyph layout algorithm/drawing will need to be rewritten to allow this to be possible.
Would be wonderful if this were implemented. I use sublime text mostly for prose, with my own custom syntax. Bold/italic for proportional fonts would be a nice bonus, despite text reflow surprises. Perhaps a hidden setting? Although I'm sure sublime prose writers are a minority.
Came here to vote after reading your super guide.
Proportional fonts do not allow for basic formatting options like Bold or Italic where they would show up in the theme for a monospace font. This is especially problematic for prose-writing in Markdown (for instance) because we want to be able to have the advantages of proportional fonts (easiness of reading) whilst still being able to have Markdown's syntax-highlighting.
OS: All Version: ST3