23 ms·
My favourite monospaced font is Triplicate <https://practicaltypography.com/triplicate.html https://practicaltypography.com/triplicate.html>: the only true seri
by chrismorgan 6y ago
My favourite monospaced font is Triplicate <https://practicaltypography.com/triplicate.html https://practicaltypography.com/triplicate.html>: the only true serif monospace that I know of (though I have a vague feeling I found one other at some point). Every other serif monospace I know of is a slab serif. Triplicate’s variable stroke thickness is also exceedingly rare in monospaced fonts; almost everyone goes for uniform stroke thickness, as is customary with sans-serif fonts but anathema for true serif fonts (though slab serifs could be either). Variable stroke thickness can be a bit iffy on low-resolution displays, but so long as you keep the size up or use a high-resolution display, I find it very pleasant. I’ve been using Triplicate everywhere for the last few years, including on my website.
(Also note on that page, since people are talking about ligatures a lot in this thread: “No, there are no programming ligatures in Triplicate, and there never will be.” with a link to https://practicaltypography.com/ligatures-in-programming-fonts-hell-no.html https://practicaltypography.com/ligatures-in-programming-fon..., which can be distilled to the quote “ligatures in programming fonts are a terrible idea”. I agree.)
Pragmata Pro and Operator are two other well-regarded and popular commercial monospaced fonts that are missing from this list.
- rvanmil 6y agoThis looks really nice, too bad it doesn't (and never will) support ligatures. I understand the point the author is trying to make about ligatures in the separate blog post, but boy do I love my ligatures when programming.
- elcomet 6y agoCan you easily differenciate between == and === with ligatures ? That's one thing that holds me back to trying ligatures.
- Aeolun 6y agoYes, it’s fairly obvious. It depends on the font, but my triple comparisons actually have three bars (you can see it in the examples I think)
- stingraycharles 6y agoFor me, I just selectively use _some_ ligatures. There are a few I like (like a lambda symbol instead of `fn` in Clojure), and the rest I just don't use.
- yoz-y 6y agoyes because === is presented as a three long parallel lines (at least in the font I use, which is JetBrains Mono)
- Measter 6y agoOf course. A `==` is two characters long, while `===` is three characters long. Also, with the font I use (Fire Code) the `===` ligature has three lines, making it even easier to distinguish.
- BrandoElFollito 6y agoI just had a look at Fire Code. How do you distinguish -> with ligatures from → (an Unicode arrow)?
- d3nj4l 6y agoThe ligaturized -> is two characters wide and is pretty easy to tell apart.
- quarantine 6y agoThe Unicode arrow looks smaller and is positioned lower, while the ligature has the same size as -> with the dash extended into the 'arrow'. Not that I use this frequently.
- matthewmacleod 6y agoPersonally, it’s never really come up. I have no Unicode arrows in my actual source code. On the occasion it’s in a string literal or whatever the it’s pretty obviously different, because it’s a single-width character as opposed to the double-width ligature.
- lucideer 6y agoThe blogpost makes some good points, but it's extremely selective in choosing examples to support the author's thesis. Mainly in that it ignores many examples of orthographic ligatures that don't fit the author's narrative. A (further deep-)linked blogpost on ligatures in general states: > Ligatures were invented to solve a practical typesetting problem. In the days of metal fonts, certain characters had features that physically collided with other characters. To fix this, font foundries cast ligatures fonts [0] But that's not true. That is why ligatures are used by many foundries more recently, but it's not why they were invented, and it doesn't cover all traditional uses of ligatures. German and French orthography in particular contain a lot of examples that are closer to programming operators in use than the author's "fi" example. [0] https://practicaltypography.com/ligatures.html https://practicaltypography.com/ligatures.html
- gvx 6y agoTo me, ligatures in programming always file like a kind of syntax highlighting if that worked on the character level rather than the token level. Suppose given `difficulty = 3` your editor would highlight the `if`. That's how these ligatures feel to me.
- indentit 6y agoBut most text editors don't render ligatures if the characters span token boundaries. Sublime Text at least doesn't.
- SamBam 6y agoThat doesn't usually happen, though. For example, if you type three '=' symbols in Firas Code or JetBrains Mono, you get ≡, but if you type a fourth '=' it snaps back to '===='. I can invent some odd situations where I get a ligature in the middle of a string, but in actual coding (for me 80% JS, 10% HTML/CSS and 10% Ruby) I simply don't see any incorrect ligatures.
- sigzero 6y agoI am not fan of ligatures because of the (although small) mental gymnastics that have to happen when reading code. It's unnecessary.
- rvanmil 6y agoI got used to them really quickly to the point that I prefer them over regular characters. No mental gymnastics required.
- systemvoltage 6y agoHow do you plan to reverse engineer the underlying keystrokes if you look at some ligature ridden code on a tutorial website? It is nice to read. That's not the only thing we do with code. Ligatures are fine for yourself in a private setting. It's popularity is alarming.
- anamexis 6y ago> How do you plan to reverse engineer the underlying keystrokes if you look at some ligature ridden code on a tutorial website? Copy and paste it in a different font.
- tshaddox 6y agoWell, you just have to learn all the popular ligature forms, just like you have to learn all the popular variations of letter forms (e.g. "a" and "g" both have very different variations that are popular in different typefaces).
- flobosg 6y ago> the only true serif monospace that I know of Sun Gallant Demi is another one. Libertine/Libertinus Mono as well.
- chrismorgan 6y agoOh cool! Thanks for broadening my horizons.
- OskarS 6y agoYep, Triplicate and is far and away my favorite programming font as well, closely followed by Operator Mono. You need to pay for both, but it was easily worth it for me.
- jansan 6y agoThe "l" looks like a big "1" in Triplicate. There is no way I will use a font like that for programming.
- flobosg 6y agoTriplicate has code-specific variants, including a curved lowercase L.
- chrismorgan 6y agoI agree with you and do consider the default l glyph to be a poor choice, insufficiently distinct from 1. Fortunately, the Code variant of the font goes for a curved tail on l, so that it’s sufficiently distinct. (However, if you try to enable both the Code and Poly features—Poly meaning “don’t be a true monospace, make characters like l and i a little narrower and characters like m a little wider”—you end up with a slightly narrower flat-bottomed l glyph, rather than a curved tail. See this, for example, in https://chrismorgan.info/blog/make-and-git-diff-test-harness/#figure-2 https://chrismorgan.info/blog/make-and-git-diff-test-harness..., which is set in Code + Poly. Disable the `code { font-feature-settings: "ss01" 1, "ss02" }` CSS rule to see the effect of removing Poly—you get the curved tail l glyph back again. I’ve been meaning to sort out a better glyph for the combination, but I haven’t gotten round to it yet, because it’s annoyingly difficult to actually do that sort of thing.)
- Sharlin 6y agoAs mentioned in [1], Triplicate includes a Code variant which disambiguates l and 1, and O and 0, and makes other tweaks for better legibility. [1] https://practicaltypography.com/triplicate.html https://practicaltypography.com/triplicate.html
- 1f60c 6y agoThere's a free monospace serif-looking font called Go (made for Go, the programming language), designed by Bigelow & Holmes: https://blog.golang.org/go-fonts https://blog.golang.org/go-fonts
- gerikson 6y agoGo Mono is my favorite console font, alternating with Plex Mono...
- bluedino 6y agoI switched to this right after it came out - it's amazing.
- flobosg 6y agoI've been using Go/Go Mono as system fonts for a while, and they're one of my favorite typefaces. Their spiritual predecessors, Luxi Sans/Serif/Mono, are also worth checking out.
- hda111 6y agoUnfortunately it isn't using a usual font license. It's not really clear under what conditions you can use/redistribute it.
- flobosg 6y agoAccording to the GP's site: > They are licensed under the same open source license as the rest of the Go project's software Which I assume is this one: https://golang.org/LICENSE https://golang.org/LICENSE
- boomlinde 6y agoIt may not be usual, but what about the licensing terms is unclear?
- hda111 6y agoIt’s unclear whether I need to include a copyright for this font in every PDF I create that uses this font. SIL Open Font License explicitly doesn’t apply to documents using this font.
- lokedhs 6y agoWhat about GNU Free Mono? I use it for APL development because it has nice APL symbols. The font itself uses serifs.
- chrismorgan 6y agoThat’s a slab serif.
- LoSboccacc 6y ago“ligatures in programming fonts are a terrible idea” I agree as well with the point about ligatures, but I find funny that the advice comes from a site that thinks straight up normal text with no hover, no distinct color, no distinct font and no underline is a good way to signal linked pages https://i.imgur.com/9iVMfgD.png https://i.imgur.com/9iVMfgD.png (who would have guessed Racket was a link?)
- jdmichal 6y agoI certainly don't blame you for not noticing the `#fbf3f3` background color on hover. However, it seems that every link is either small caps or has that trailing ° character. It looks like the former is used for internal links, and the latter for external. I agree that they're certainly not screaming, but considering that the author considers this a book, that is probably by design.
- LoSboccacc 6y agothen again, the signature is indistinguishable from small cap and isn't a link
- deleted 6y ago[deleted]
- leptons 6y ago"Ligatures in programming fonts—a misguided trend I was hoping would collapse under its own illogic." The same could be said about so many programming conventions most people take for granted. Sometimes programmers are their own worst enemies. "just because you can doesn't mean you should" is probably the #1 rule of programming, at least for me, and ligatures definitely fit into that category.
- th3ant 6y agoIn short it’s a design choice paying homage to some other books, as well as to make the reading experience less distracting. He has a whole page explaining here, https://practicaltypography.com/how-to-use.html https://practicaltypography.com/how-to-use.html
- ubercow13 6y agoThis looks very nice, but I can't pay that much for a coding font like this simply because until you load it into the various pieces of software you use it is impossible to know how it will render. Especially on a non-hidpi screen. Chances are it will look significantly different than the PDF once you load it into your terminal. Each of the three terminal emulators I have installed already render fonts very differently from each other.
- oniskanen 6y agoThe author offers a pretty good 30 day refund policy if the font doesn't work in your use case: "Triplicate has no demo version, but I do offer a 30-day return option: if the fonts aren’t your style, you can cancel your license for a refund." As for the customer service experience, the author himself has responded (within the day even) to a couple of emails when I had questions about licensing.
- thiagotomei 6y agoThey give a 30-day free trial, it seems (last item in the 5-reasons list): "Triplicate has no demo version, but I do offer a 30-day return option: if the fonts aren’t your style, you can cancel your license for a refund."
- ubercow13 6y agoAh thanks, I didn't spot that. That's good enough!
- DrBazza 6y agoPersonally, my eyes and brain just can't scan ligatures in code efficiently, I have to double read the code, especially "is that =, ==, or ===? Oh, and that's !==" (edit) I'll additionally qualify my comment, from a mathematics background I can casually scan a handwritten "!=" which is the same as the ligature, but I just cannot retrain my adult brain to accept the ligature version which is the same as the handwritten one. Brain plasticity I suppose.
- LandR 6y agoI find some ligatures help a lot. I can often miss != but won't miss ≠ or ≢ I think the whole idea of pre-pending ! to negate is a poor idea in general, it's too hard to spot especially in long convoluted lines where it's just thrown in before a complex bracketed expression.
- Lukas_Skywalker 6y agoI sometimes use a triple negation !!! for that reason. I don‘t know if there are any drawbacks, especially if there are other people working on the code, but it worked pretty well for me so far.
- pvorb 6y agoThat might work until there's somebody who uses double negation !! for some reason. But this might only be common in JavaScript, so YMMV.
- LandR 6y agoI had to google this to see why on earth you would use double negation. Apparently it's a way to negate and convert to boolean.
- franga2000 6y agoYes, it's one of those dirty JavaScript tricks that abuse type conversion. Negation converts anything into a boolean, so if you negate that again, you get the equivalent of converting the into a bool. In standard (old) JS fashion, it's both slower and less readable, but people still (used to?) do it. Similar hacks include 1* for num->string and +"" for the opposite, along with several others that I have luckily managed to forget.
- joshuaissac 6y agoI agree with the author on adding ligatures where they are not needed, but one of the comments used in their justification is not quite right: > Unicode [...] identifies each character uniquely. This way, software programs don’t have to worry that things like the fi ligature might be stashed in some special place in the font. Instead, Unicode designates a unique name and number for each character, known as a code point. If you have an fi ligature in your font, you identify it with its designated Unicode code point, which is 0xFB01. This is true for the Roman script, but for many other scripts, Unicode does not provide dedicated code points for common ligatures. They would instead have to be denoted by two characters with a zero-width joiner in the middle (much like emojis).
- WorldMaker 6y agoAlso, most Unicode experts would tell you not to use 0xFB01 in new stuff today and instead should rely on font ligatures for it. 0xFB01 was included in Unicode for cross-compatibility with older encoding schemes for systems that didn't support fonts with ligatures. Today we have support for fonts with ligatures.
- buckminster 6y agoI'm not a fan of symbol ligatures but what I really loathe are monospaced fonts with a single character width fi ligature so the f and the i are both half width. I've seen several websites recently using fonts that do this. It is very visually distracting, especially in code samples.
- SamBam 6y agoReally? So it's not monospaced? I'm having trouble imagining any monospaced font doing this. (The ligatures in fonts such as Fira Code take up the same amount of space as the non-ligatured versions.)
- buckminster 6y agoI can't imagine why anyone would do this either. I suppose one possibility is that some software in their web stack is converting fi to an explicit fi ligature and the monospaced font chosen by the web page doesn't support it so the browser does a substitution. When I spot another one I'll have to dig more deeply.
- crazygringo 6y agoOn Macs, Courier (but not Courier New) can do it, though not by default. (Open up TextEdit, enable Rich Text, select Courier, type "ff", highlight it, go to Font > Ligatures > Use All. The "ff" will now take up the width of a single character.) I've run into a bug where certain styles of Courier Prime turns into ligatures in Google Docs. (Long story short, whether or not ligatures get enabled is a complex interplay between the OS, font, browser, and application, and not every layer always does it right.) I'm not really sure why font designers even bother creating them in monospace in the first place though, I can't imagine any valid use for them. The only thing I can imagine is if a badly written application forces a ligature character, at least the end result will be readable rather than an empty box or something.
- ajarmst 6y agoTriplicate has a nice look, but l (lowercase L) and 1 (one) are indistinguishable, which is an immediate non-starter for me in a programming font. (CORRECTION: there is apparently a code version that disambiguates these and others. See comments. That means this probably would be a candidate font for me, except:) I finally just paid for Pragmata Pro, and haven't regretted it. The unicode support is incomparable, and for someone who lives in emacs and console, support for things like the Powerline glyphs and the option to use Emacs' prettify-symbols mode means an awesome user experience. I actually like ligatures when reading code, less so when writing. The thing I like about prettify-symbols and a font like pragmata pro is that I can toggle between strict representation and a cleaned up version with things like the below replacements: (defun aja/pretty-symbol-push-default () (push '("!=" . ?≠) prettify-symbols-alist) (push '("<=" . ?≤) prettify-symbols-alist) (push '(">=" . ?≥) prettify-symbols-alist) (push '("=>" . ?⇒) prettify-symbols-alist) (push '("->" . ?→) prettify-symbols-alist) (push '("lambda" . ?λ)prettify-symbols-alist))
- joombaga 6y agoThere's a code variant that disambiguates 1 and l (and others).
- ajarmst 6y agoDidn't notice that. Thanks for the correction.
- citizenkeen 6y agoBut it makes the code Small Caps, which I find unusable in code.
- chrismorgan 6y agoI think you’re confusing Triplicate C4 (C for Caps) with Triplicate T4’s Code variant (T for Text).
- ryukafalz 6y ago
- antonios 6y agoThere's also CMU Typewriter text if you want another serif monospaced font. Looks wonderful in high dpi I believe. I've hacked mine to put slashed zero.
- chrismorgan 6y agoThat’s a slab serif.
- unicornporn 6y ago> My favourite monospaced font is Triplicate: the only true serif monospace that I know of Also: https://github.com/yellow-type-foundry/xanhmono https://github.com/yellow-type-foundry/xanhmono / https://fonts.google.com/specimen/Xanh+Mono https://fonts.google.com/specimen/Xanh+Mono
- chrismorgan 6y agoCool! I hoped that line would get people to show me a few more, and it has.
- bitwize 6y agoTriplicate looks like Gallant, the font used by old Sun workstations. Looking like Gallant is a point in its favor (but ouch! That license fee is to its detriment.)
- scruple 6y agoWhat's the decision process behind _choosing_ a font? I've always gone by look and feel but I've never felt fully satisfied with any of the (code) fonts I've chosen. I used Incosolata for a long time and in the last year I've moved to Hack. I really like Hack a lot but I am also trying harder to make more conscious decisions with my physical programming environment as I age (beyond aesthetics, caring about ergonomics, etc...).
- uncanneyvalley 6y agoI'm dyslexic. Because of that, I've spent a bit of time thinking about this for practical reasons. I prefer heavier sans-serif fonts with no character ligatures, but I like symbol ligatures and glyphs; they're not deal breakers. I've been using Cascadia Code, and find it usable, don't like the dotted 0 (the fact that the top and bottom of the 8 round in sharply helps offset this) or the few serifs it has. I've used Ubuntu Mono (spacing is too tight) and Source Code Pro (lines are too light) in the past. What I look for is legibility between things like ({}), l1!|I, Oo08, mwnu, tl bpdq, ecoa, and being able to distinguish repetitio and symbols like --, ==, !!, "'`, :;, _-, and even ,.. (Something's going to try to parse that and absolutely shit itself) I just grabbed B612 Mono. n.b. I hadn't actually assembled those thoughts into one place before now. I apparently have Opinions about this!
- utxaa 6y agoi can't find any pictures of triplicate with a dark background. could you share any? some hefty fonts (ie, go mono, courier) look so different when you change backgrounds that i am hesitant to buy without looking at a sample. TIA
- chrismorgan 6y agoMy own website has a dark theme if you have @media (prefers-color-scheme: dark), or if JavaScript is enabled, there’s a switcher in the top right hand corner. Note however that I use Triplicate T3 in the dark theme (300/700 for regular/bold), compared with Triplicate T4 in the light theme (400/700). You can fiddle with the @font-face declarations in dev tools (the font change happens in 2019b-dark.css) if you want to try swapping it out. https://chrismorgan.info/blog/rust-fizzbuzz/ https://chrismorgan.info/blog/rust-fizzbuzz/ has a bit of code, some other articles do as well.
- utxaa 6y agook; so i bought the font. it's beautiful! wow. thanks.
- utxaa 6y agothank you! this helps. as i suspected it is the best font i've seen for programming with a light background, and just meh with a dark background. i prefer a dark background though, and the only font that i can tolerate with dark is pragmata pro. sigh being so aware of fonts is a curse. thanks again.
- libria 6y agoI'm not clear on the outcry against ligatures. This is a client-side setting and not committed to code, is that right? If so, this is like prescribing that we should use dark-mode over light-mode because I like it. Now during the pandemic we might screenshare more often so I can disable it for that, but for development on my own time on my own screen it's nonyabizness.
- optimuspaul 6y agoI was going to complain about them because there are a few fonts there I like a lot, but not the ligatures. Wasn't sure if it was = or == or === in the samples.
- libria 6y agoYou can disable the ligatures for all those fonts and only see =, ==, === explicitly.
- RobertKerans 6y agoPeople like Having Opinions About Things In Public. For ligatures it's bikeshedding taken to absolutely ridiculous extremes. It's past prescribing night/dark mode, it's at the level of pre/proscribing colour themes in a text editor. It is a personal choice and it doesn't affect anyone else bar me. If you don't like ligatures, I don't care, it has no bearing on whether I like ligatures (and it is a personal choice, what fonts are easier to read is always based on what I'm used to reading text in) /rant
- chrismorgan 6y agoI disagree that it doesn’t affect anyone else. The only way it can truly not affect anyone else is if no one else knows that you use ligatures. And dark/light is fundamentally different: it doesn’t actually change the content, just the colours. Similarly most font choices are purely presentational in effect, with the variation easily within what a normal viewer can be expected to read. (There are exceptions; for example, I’ve seen a couple of fonts go for a very old style of r in their fancy joined-writing style italics which Indians will have no trouble reading, but which has completely fallen out of use in most of the English-speaking world, certainly in Australia, and so may be difficult to read.) But ligatures change the actual glyphs, so that your fingers must type something other than what your eyes see, and any viewer must decode the ligature’s meaning. And this is the key reason why the proliferation of ligatures in coding fonts becomes a problem for everyone. If anyone else ever sees your screen (in person, in a screencast, or in teleconferencing with screen sharing), it has affected someone else. At an objective level, I think it’s fairly clear that for most people in most circumstances, a light background is superior to dark, and ligatures are a bad idea. However, at a personal level, the subjective factors routinely outweigh the fairly slight objective factors. Popularity breeds popularity. I have been exposed to ligatures in coding fonts on websites and other people’s screens. I never chose to use ligatures. There’s an ancient philosophical question about personal freedoms in all this.
- franga2000 6y agoRe:ligatures: Unless you're programming in something like Brainfuck, ligatures are simply not going to fail because the operators that have ligatures are pretty much universal. The situation of mixing up ligatures and their respective unicode chars is also nonsense, as those characters aren't typable and will only ever be used in strings, so there's no way you'd not know which it is and it's pretty easy to check anyways. Programming ligatures provide a tangible benefit to many of us, so the author's insistence that they are a terrible idea is simply ridiculous (although, reading through some other articles on the site, not too surprising, as the site is 80% good common-sense advice and 20% poorly explained personal opinions being treated as gospel).
- bmn__ 6y ago> those characters aren't typable and will only ever be used in strings Raku wants to have a word with you. https://docs.raku.org/language/unicode_ascii https://docs.raku.org/language/unicode_ascii https://docs.raku.org/language/unicode_entry https://docs.raku.org/language/unicode_entry
- arh68 6y agoAs far as serif monospace, NSimSun is still my favorite. It's in Windows. I love Triplicate but can't bring myself to purchase yet. I like Equity, too. I think Triplicate is the closest to the old Selectric Prestige font, which I loved. But if anyone has NSimSun replacements (paid or free), please let me know.
- kamiheku 6y agoA sibling post [1] mentioned Xanh Mono, which looks similar to NSimSun IMO. They both have that distinctive "Latin script alongside eastern script" serif look. [1] https://news.ycombinator.com/item?id=25161756 https://news.ycombinator.com/item?id=25161756
- unicornporn 6y agoEquity, a mono serif? Where do you find that one?
- chrismorgan 6y agoEquity is being mentioned as another of Matthetw Butterick’s fonts—a serif, not a monospaced font.
- musicale 6y agoI like the true italics - they remind me a bit of the Light Italic typeface on the IBM Selectric (which has been discussed recently on HN I think.) IBM developed a number of beautiful and legible typefaces for its typewriters and I'd love to have them all as screen fonts.
- hrbf 6y agoGo Mono is another nice looking serif monospaced typeface I use.