foz 10 years ago

As a developer, I have spent years writing and learning to parse the meaning of sequences like ==, ===, <=, ~=, and so on. For nearly all of us, the ligatures in this font are completely new. I think it's a creative and interesting idea, but it means re-training my brain to recognize them, which would take time.

And even if I could get my preferred editors to work with it, I would see the traditional symbols when reading code on the web, or pairing with another developer who does not use the font. It seems like a barrier to understanding, something that by nature developers strive to eliminate.

I'm torn. This idea could be something that changes how we all express code symbolically, or it will just become a fad that a tiny percentage of developers will insist on using, to the frustration of everyone else.

  • evolve2k 10 years ago

    > ..developers will insist on using, to the frustration of everyone else.

    I'm thinking It won't change the underlying text so I imagine it will only apply to the individual developer choosing to apply these ligatures on their display, as such should have little effect on other devs. Unless you mean to say people might start to use this in documentation and code examples, in which case this is indeed an interesting thing to consider.

  • tonsky 10 years ago

    Let’s be realistic. You don’t have learn or retrain your brain to understand Fira Code. Symbols are all the same, they just look better.

    • Terretta 10 years ago

      Nope. Fira gets semiotics subtly wrong.

      For instance, the HTML comment bookends. In Fira, they are long arrows. In plain ASCII they are enclosing brackets connecting to comment.

    • lttlrck 10 years ago

      The difference between e.g. -> and --> is a length of a small solid line. To me that's equates to a huge drop in readability, countering the easy to brain-parse argument.

      • tonsky 10 years ago

        Agree, but no language uses both -> and -->

RubyPinch 10 years ago

that looks amazing, but I kinda wish that certain ligatures were optional (which they might be, need to look at the CSS docs again for atom)

I (personally) don't exactly want == to look too similar to a single =, after all!

  • leonatan 10 years ago

    They don't. The == variant is has double the width.

    • RubyPinch 10 years ago

      I am aware, I still find them too similar for my likings

      • tonsky 10 years ago

        Have you tried the font? = and == has 3× difference in width, it’s hard to mistake one for another. I’m using Fira Code for a year now, never had mixed them up

    • codezero 10 years ago

      At least for me, monospaced fonts are very helpful for looking at column specific features. == and === are row specific, so seeing the delimiters between them makes them easier to parse on a row level for me.

      • bjz_ 10 years ago

        `===` is triple stroked in these fonts, but that is probably not enough for you. Just saying though! :)

        • codezero 10 years ago

          Thanks for pointing that out, I didn't notice! I think that I could get used to that.

    • to3m 10 years ago

      I upvoted your post on account of the dry humour.

  • simoncion 10 years ago

    > I (personally) don't exactly want == to look too similar to a single =, after all!

    Me, either!

    Amusingly (irritatingly?), /== has separation between the = characters. :/

    I... have no idea why ~= turns into ~-on-top-of-= and =~ into =-on-top-of-~ . Some of these glyphs just seem ill-advised. :(

    • striking 10 years ago

      tilde-equals is the "inequal" operator in Lua, so I suppose that makes some degree of sense. Then again, the equals-tilde makes zero sense.

  • mborch 10 years ago

    Escape using zero-width space character to break up the ligatures ...

anentropic 10 years ago

"Your eye spends non-zero amount of energy to scan, parse and join multiple characters into a single logical one."

citation needed

  • ryanobjc 10 years ago

    The brain is very good at turning complicated features in to abstract concepts. In fact that is mostly what some parts do. So, not clear if this actually improves things or not.

    For example, the == and === look quite a bit similar in the font. You have to compare relative sizes, whereas with the normal fonts you can count the spaces.

    The rest of the ligatures look pretty cool!

    • tonsky 10 years ago

      You probably mean = and ==. They have 3× difference in width, which, in practice (I’m using Fira Code for a year now), is more than enough to tell the difference.

      Regarding the difference between == and ===, latter has three lines (and so does !==), so in fact in Fira Code === and !== the looks implies the meaning, whether in other cases you have to bend your mind to accept that negation of “three equals” is a “two equals and a bang”

z1mm32m4n 10 years ago

I'm not sure why this has to be done in the font. Vim has support for conceal characters, which can "conceal" syntactic constructs into other characters, i.e., any Unicode code point. This works out pretty well in LaTeX documents for example, because you can see the mathematical symbols. [1]

One gripe I have though is that columns become misaligned when you have concealed characters or ligatures. In the source, \alpha is 6 columns and \beta is 5. Displayed, α and β are both 1 column. This messes up things like visual block insert mode, because the location of that column in the source and what's being displayed might differ. Should you line up the displayed version and make it look nice for you and those with the same plugin, or don't you?

[1]: https://github.com/vim-pandoc/vim-pandoc

vdaniuk 10 years ago

I have been using Fira Code font with Atom for some time and I am absolutely in love with the aesthetics. All credit and praise goes to http://tonsky.me/

aw3c2 10 years ago

= vs == vs === seems like a sure way to have bugs.

  • donatj 10 years ago

    My thoughts exactly. Probably depends on the person but I am certainly the type who would have trouble detecting the difference.

    • tonsky 10 years ago

      Just give it a try. There’s 3× difference in width, so _in practice_ you won’t mistake them, ever. I’m using that font for a year now, not a single case of misreading

  • espadrine 10 years ago

    The use of triple bars for === strongly distinguishes it visually from the two bars of ==, which is a nice touch.

melted 10 years ago

After so many years, there's still no better coding font than MS Consolas. I use it everywhere (where by "everywhere" I mean Linux and OSX, since I don't use any MS products other than this font).

codezero 10 years ago

This is really cool, but I must be getting old, because I find it particularly difficult to parse.

tanyared 10 years ago

My vision is not 100% and when I code for a few hours my eyes get tired and it gets even worse. Fira Code helps! Thank you, tonsky <3

  • tonsky 10 years ago

    So happy to hear that!

gravypod 10 years ago

I feel that if you hide the text you need to type to insert a symbol, learning a new language might be hard.

For instance, some languages use != and others use ~=. If both of those look the same, you're going to have one hell of a time learning a language.

Luc 10 years ago

I'm trying out Atom, and ligatures in Erlang don't always render. For example, -> in the head of a function clause doesn't render as a ligature, while inside the function body it does.

EDIT: In developer mode I can see the -> is being rendered as two single character <span>s when in the head of the function. The solution is probably to fix it in the grammar definition: https://github.com/jonathanmarvens/atom-language-erlang/blob...

  • melloclello 10 years ago

    I found the same thing, in Ruby -> was split up, while in Swift it was fine.

golergka 10 years ago

So, neither Emacs, nor vim (and none of it's gui variations) are supported.

jibsen 10 years ago

I tried using ligatured when Pragmata added them, but the issues made me return to the normal version.

If you use your editor for multiple languages and documentation as well, you may find things like lines in comment blocks made of '%', '#', or '-' to break from the ligatures. Also if your doc markup(-down) uses underlines of '-' or '=' for headings, they are affected.

On Windows, I found some editors where the ligatures were enabled, some where they weren't, and not many where you had any option to toggle either way.

yawaramin 10 years ago

Really cool, but what, if any, are the plans to get it working with Vim? It's the universal editor you're likely to find everywhere.

  • wffurr 10 years ago

    Vim isn't there problem, it's your terminal. There is an open feature request with iterm2, but terminal.app is probably a lost cause. I know nothing about the state of Unicode font rendering in Linux.

    • baghira 10 years ago

      It works fine under konsole 15.08.

      • gh02t 10 years ago

        Konsole is the only terminal emulator I could get it working with, which is annoying because I much prefer rxvt. Konsole does weird stuff with my terminal colors in tmux, so I ended up not being able to use this nice font when I tried it previously.

        • endgame 10 years ago

          Have you tried urxvt, by any chance?

          • Tiksi 10 years ago

            Tried to get it at least readable for 15 mins or so and gave up: http://paste.click/msFBVy

            Tried all kinds of variations of

                > fnt="xft:Fira code:pixelsize=10:size=15"; urxvt -fn "$fnt" -fb "$fnt" -fi "$fnt" -fbi "$fnt" -letsp -1
            

            Can't get the font spacing to not be massive and the ligatures don't work.

            My build is:

                rxvt-unicode (urxvt) v9.21 - released: 2014-12-31
                options: perl,xft,styles,combining,blink,iso14755,unicode3,encodings=eu+vn+jp+jp-ext+kr+zh+zh-ext,fade,transparent,tint,pixbuf,XIM,frills,selectionscrolling,wheel,slipwheel,smart-resize,cursorBlink,pointerBlank,scrollbars=plain+rxvt+NeXT+xterm
            
            

            Edit: Tried hasklig that was mentioned. Ligatures still don't work but the spacing is fine: http://paste.click/cEWQZs

          • gh02t 10 years ago

            By "rxvt" I meant rxvt-unicode/urxvt. I'm quite fond of it, but it doesn't support glyph ligatures.

    • ufo 10 years ago

      What about gVim?

    • tonsky 10 years ago

      Strangely enough, I had Terminal.app listed as not supported (at it wasn’t when I checked).

      But checking now, ligatures render just fine. Yay! (that implies console vim & emacs, of course)

epmatsw 10 years ago

I love the ligatures (arrows and fat arrows in particular), but the @ sign is so jarringly strange. It distracts me every time

legulere 10 years ago

Probably not possible with ligatures/glyph variants but really cool would be grouping of numbers: In groups of three the first digit would be moved to the right and the last one to the left to simulate a narrow space as thousands separator.

  • duskwuff 10 years ago

    I suspect that it's possible, but would require an impractical number (1000) of ligatures in the font.

  • CamperBob2 10 years ago

    It's a shame the C/C++ standards committee(s) didn't just copy Verilog's base-n notation when they added the "0b" prefix. It's nice to be able to write large constants with optional underscores every four or eight digits, e.g. 32'hffff_0867_5309_beef, or 12'b1101_1110_1010.

    • Someone 10 years ago

      You can write 1'000'000 for a million in C++14. http://en.cppreference.com/w/cpp/language/integer_literal.

      They didn't use underscores because _100_000 is a valid identifier in C/C++.

      Arbitrary bases aren't there.

      • CamperBob2 10 years ago

        Neat, I didn't know they'd done something similar with single quotes. (No law said they had to allow constants to start with an underscore, of course...)

wila 10 years ago

Probably a silly question, but can't we just generate ttf files from this so that you can use it in any windows editor?

  • zerocrates 10 years ago

    I think the relevant issue is whether the editor can render the OpenType ligatures (well, contextual alternates) contained in the font.

    You _could_ convert to .ttf, changing the curves to TrueType-style quadratics, but they'd still have to have the OpenType substitution tables for the "ligatures" to work, and I don't think that would really improve compatibility much, if at all.

  • tonsky 10 years ago

    Are there any problems with installing otf on windows? I installed and used them just fine

    • wila 10 years ago

      See I knew it was a silly question :) A few minutes ago I converted the otf files to ttf using font forge. That appeared to work, but it seems the ligatures are gone. On top of that the ttf version of the font did not show up as a monospaced font in my code editor. I might have done something wrong though as I only dabble a bit with font forge.

      Then I just did what you suggested, install the otf instead (d'oh) Now the fonts do show up as monospaced font. But my editor does not display the ligatures. But at least it is usable.

chrissnell 10 years ago

What software is typically used to create a font like this? Are there any good open source options?

  • ygra 10 years ago

    The readme says "Fira Code is now drawn and built in Glyps 2 app (should improve compatibility)."

  • tonsky 10 years ago

    Glyphs.app provided a free license for Fira Code since font is open-source. I’m using it because original Fira Mono is developed in it as well.

    Monoid uses FontForge (free)

pekk 10 years ago

On what planet does it make sense to release a programming font which explicitly refuses to support both vim and emacs?

  • jumpwah 10 years ago

    Exactly. However I see now that there's an Emacs workaround... maybe I'll try that some time.

  • ygra 10 years ago

    The ligatures don't work because lots of editors don't bother to use text rendering that supports ligatures. It's an interesting perspective to blame that on the font.

  • PhasmaFelis 10 years ago

    I think you've got that backwards.

  • laumars 10 years ago

    Vim and emacs are terminal applications, thus it's down to the terminal emulator to support the font. Some terminal emulators do (eg Konsole). However many do not.

    Frankly, I'm amazed at the number of programmers who have made the complaint about vim and emacs support since writing terminal applications (ie stuff that prints to STDOUT) is basically programming 101. It should be pretty obvious to any programmer where the support is required.

    • throwaway999888 10 years ago

      Emacs is a graphical application to me. That's the default behaviour, how I use it, and what I see people doing things like screencasts use.

      • laumars 10 years ago

        That's not emacs then, it's a Cocoa / Win32 / whatever port of emacs. Unless your talking about "graphical" in the same sense that ncurses is. But either way, emacs default behaviour is a terminal application.

        • throwaway999888 10 years ago

          GNU Emacs 24.3.1

          Copyright (C) 2013 Free Software Foundation, Inc.

          `emacs` launches a graphical window.

          Any objections?

          • laumars 10 years ago

            I just installed GNU Emacs on my PC and it seems you're right. I swear that never used to be the case; or maybe I've only ever used emacs on headless servers so it defaulted to the terminal renderer? Weird - but sorry for arguing with you on that point.

            • throwaway999888 10 years ago

              :-) I guess even ancient 80s (?) software keeps with the times to some degree. Notwithstanding all the idiosyncratic (in our environment) defaults for ergonomics and terminology..

  • tonsky 10 years ago

    On what planet people still use teletype emulators to edit code?