tonsky / FiraCode

Free monospaced font with programming ligatures
SIL Open Font License 1.1
77.26k stars 3.1k forks source link

Partial ligature support (Emacs 24.4.3, 24.5.1, Windows (unable to work under Ubuntu)) #100

Open vputz opened 8 years ago

vputz commented 8 years ago

With the Wiki support using composition-function-table, I have some ligature support under Windows, but not all (for example, ++ == !== ===, <| <|>, and the like, but frustratingly not more Clojure-useful ones like -> ->> etc). The regexes should have matched the appropriate ligatures, but maybe font-shape-gstring wasn't giving a proper result? This is a bit of emacs wizardry that puzzles me, but I tested the regexes for the arrows (the (45. line) and I feel like it should have worked. So I can't tell if this is a platform, Emacs, or FiraCode issue.

Attached is a clip showing the results of the ligatures from the FiraCode front page to show which are getting results and which aren't. This was under Windows 7 and emacs 24.4.3 and 24.5.1; I attempted it under 24.4.3 using Ubuntu under VirtualBox and no ligatures worked (not certain why).

firacode_lig_windows

jrblevin commented 8 years ago

Modifying the regexp for 59 from .\\(?:;\\) to .\\(?:;;\\|;\\) fixes the triple-semicolon ligature, which happens to be nice for Emacs Lisp comments. Similarly, updating line 58 fixes the triple colon: .\\(?:::\\|[:=]\\).

jrblevin commented 8 years ago

I'm not entirely sure if this will fix the issues you were having on Windows, but I updated the regular expression on the Setting up Emacs page. It now matches 25 additional ligatures for me (OS X 10.11.4 with Emacs 25.1.50.1) including all of the arrows above, triple question marks, exclamation points, and semicolons, www, 0xF, etc.

Here is a before and after preview with three frames: no ligatures, previous regexps, new regexps: fira-code-showcases-emacs-small

tonsky commented 8 years ago

Awesome! Thank you!

On Wed, Apr 13, 2016 at 1:45 AM Jason Blevins notifications@github.com wrote:

I'm not entirely sure if this will fix the issues you were having on Windows, but I updated the regular expression on the Setting up Emacs https://github.com/tonsky/FiraCode/wiki/Setting-up-Emacs page. It now matches 25 additional ligatures for me (OS X 10.11.4 with Emacs 25.1.50.1) including all of the arrows above, triple question marks, exclamation points, and semicolons, www, 0xF, etc.

Here is a before and after preview with three frames: no ligatures, previous regexps, new regexps: [image: fira-code-showcases-emacs-small] https://cloud.githubusercontent.com/assets/12706530/14473323/7574789a-00c5-11e6-892d-baf70b062c0e.gif

— You are receiving this because you are subscribed to this thread.

Reply to this email directly or view it on GitHub https://github.com/tonsky/FiraCode/issues/100#issuecomment-209074201

yurrriq commented 8 years ago

Modifying the regexp for 59 from .\\(?:;\\) to .\\(?:;;\\|;\\) fixes the triple-semicolon ligature, which happens to be nice for Emacs Lisp comments. Similarly, updating line 58 fixes the triple colon: .\\(?:::\\|[:=]\\).

Neither of those statements hold true for me on macOS 10.12 and Emacs 25.1.1. Might I have an outdated version of Fira Code?

Update: I just installed 1.203 and ;;; and ::: are still rendered incorrectly. I should mention, too, the workaround in https://github.com/tonsky/FiraCode/issues/158#issuecomment-218962919 makes it so Emacs doesn't hang on stuff like M-x and helm-ag. All other ligatures seem to be working very well, so I hope I (or someone else) can solve the ;;;/::: issue.