Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proportional Fonts and Formatting #279

Open
willthong opened this issue May 2, 2014 · 20 comments
Open

Proportional Fonts and Formatting #279

willthong opened this issue May 2, 2014 · 20 comments

Comments

@willthong
Copy link

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

@FichteFoll
Copy link
Collaborator

Does this apply to all proportional fonts or just specific ones you tried? Can you name examples?

@willthong
Copy link
Author

Proportional font faces I've tried:

  • Georgia
  • Times New Roman
  • Arial
  • Charter
  • Gill Sans MT
  • Helvetica
  • Ubuntu
  • Papyrus
  • Comic Sans MS (for jokes)

Monospace fonts it works for:

  • Consolas
  • Courier
  • Ubuntu Mono

@willthong willthong reopened this May 2, 2014
@FichteFoll
Copy link
Collaborator

Can confirm with all your fonts and a few more,

  • Hobo Std
  • Times
  • Kaiti
  • Segoe Print
  • Verdana

@andipower
Copy link

Same here.
Font Lucida Console can't be displayed italic and bold either
OS: Windows 7
Version: ST3

@dpmccabe
Copy link

dpmccabe commented May 1, 2015

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?

@eugenesvk
Copy link

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

@reagle
Copy link

reagle commented Dec 30, 2016

I just saw this discussion. Sounds like it will not be fixed.

@FichteFoll
Copy link
Collaborator

@reagle, I'm positive this is not the page you wanted to reference.

@reagle
Copy link

reagle commented Jan 10, 2017

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

@wbond
Copy link
Member

wbond commented Apr 21, 2017

Marking this as an enhancement request, since we are purposefully not enabling italic and bold when a font is not monospace.

@mcclowes
Copy link

Why are you purposefully not enabling italic and bold?
This would be very useful for me

@wbond
Copy link
Member

wbond commented Nov 16, 2017

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.

@eugenesvk
Copy link

@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)

@mcclowes
Copy link

@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?

@wbond
Copy link
Member

wbond commented Mar 20, 2018

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.

@mmerline
Copy link

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.

@tonsky
Copy link

tonsky commented Feb 21, 2021

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

Screenshot 2021-02-21 at 18 33 48

Screenshot 2021-02-21 at 18 33 26

Screenshot 2021-02-21 at 18 30 21

@bitsper2nd
Copy link

Came here to vote after reading your guide.

@YBPN
Copy link

YBPN commented Aug 28, 2021

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.

@pedromagician
Copy link

Came here to vote after reading your super guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests