The thing I like about Iosevka is that you can build it with different sets of ligatures, and I’ve configured my Emacs to use the version of Ioseveka specific to the language in the buffer. That’s sort of cool. Of course, I’ve now officially spent more time setting Emacs up to write Haskell and OCaml in than I have actually writing Haskell or OCaml, but, you know, you gotta start somewhere.
I think you’re doing fine. I’ve spent more time reading about people setting up their Emacs than I ever used Emacs
Hah! Nice. I can certainly empathise with spending more time configuring Emacs than actually using it to write things. Do you have your configuration published anywhere? I’d be interested in seeing the font set-up :)
In the interest of sharing, here’s mine: https://github.com/cmacrae/.emacs.d
Here’s some horrible elisp, assuming “Iosevka Haskell P” and “Iosevka ML P” are proportionally spaced versions of Iosevka with the appropriate ligatures defined:
(defun jfb/frame-is-displaying-?-buffer (frame mode)
(eq mode (buffer-local-value 'major-mode (car (buffer-list frame))))) ;; this assumes that the first buffer in a frame's list of buffers is the visible one. Sigh.
(defun jfb/frames-that-? (predicate)
(seq-filter predicate (visible-frame-list)))
(defun jfb/assign-font-to-frame (predicate-to-pick face-to-assign)
(setq frames (jfb/frames-that-? predicate-to-pick))
(if frames (set-frame-font face-to-assign
(defun jfb/define-haskell-font ()
(jfb/assign-font-to-frame (lambda (f) (jfb/frame-is-displaying-?-buffer f 'haskell-mode)) "Iosevka Haskell P:weight=ultra-light:slant=normal:width=normal:spacing=100:scalable=true"))
(defun jfb/define-ocaml-font ()
(jfb/assign-font-to-frame (lambda (f) (jfb/frame-is-displaying-?-buffer f 'tuareg-mode)) "Iosevka ML P:weight=ultra-light:slant=normal:width=normal:spacing=100:scalable=true"))
(defun jfb/fixup-fonts ()
(global-set-key [f9] 'jfb/fixup-fonts)
I always try to teach Haskell using nano otherwise everyone is like “ooo what are you using?” and “can I get something like that but for jEdit/Sublime/Atom/VS?”
How are you handling ligatures? AFAIU emacs doesn’t render opentype ligatures?
On MacOS it does!
It doesn’t out of the box, no - even if the new shaping engine might help on that front? - but you can tell it to use different glyphs for arbitrary character combinations. There’s apparently at least three different ways to tackle this, by using prettify-symbols-mode, a composition table, or font-lock. All of them, though, are specific to a single font, but there should be instructions for most of them nowadays.
Ligatures are some of the finest things known to man. Are you familiar with Chartwell? Are you doing that sort of thing in emacs?
I’ve used so many fonts over the years, and the one I always come back to is DejaVu.
DejaVu has this perfect balance. Nothing sticks out too much. You don’t even notice it.
I wish more fonts were based off of DejaVu at the very least to benefit from all the work put into it.
There are many fonts based off DejaVu:
Except they are hardly even derivatives…
Can’t say anything about Expresso Mono - no information on it.
Menlo by Apple actually seems like a really great improvement. I wonder why DejaVu guys don’t absorb the changes. They seem legitimately good: https://leancrew.com/all-this/2009/10/the-compleat-menlovera-sans-comparison/
Edit: I’m actually surprised the author of that menlo post says it doesn’t improve the font, when the mouse-over clearly shows the changes do improve the font in many ways…
Edit: So I tried it quickly. I can see why the author says what they say… Even though there are tiny balancing adjustments, Apple made some elements too heavy, like periods and commas…
Since DejaVu Mono is my default system font for fixed-width text, I also always end up sticking to it. Tried using IBM Plex a while ago, and it was nice, but I didn’t have it installed everywhere. Then Fixed until a week ago, but that has scaling issues, or basically won’t look nice with anything but the default settings.
I guess it is sort of like Debian for me: Boring, but I always keep coming back to it.
same but bitstream vera sans mono
As I understand it, the DejaVu fonts are the same as Bitstream Vera ones, except that thye support more glyphs?
i think the bitstream ones are narrower than the dejavu ones, but i could be wrong; it’s been a while since i checked. if they’re the same i should switch over.
Boy this font is narrow… This will encourage people to use very wide character margins, especially combined with maximized windows on big monitors. It’s getting harder and harder to explain to programmers that keeping your code no wider than 80-100 characters is a good discipline that makes you think about code structure, short descriptive names, and ultimately leads to more readable code. But all I hear in response these days is “but surely your monitor is wide enough”, which completely misses the point.
but surely your monitor is wide enough
but surely your monitor is wide enough
Exactly, wide enough to fit at least two windows of code side by side!
Do folks using ligatures not incur the cognitive cost of wondering what two (or more) keys were pressed to create a given ligature? Especially when reading other peoples’ code. This is a nice customizable font, but I’m set in my ways w/ source code pro.
Iosevka has the term variant for people who don’t want ligatures.
Agree on Source Code Pro, an amazing font.
Not really–the ligatures are just stylized combinations of the keys in most cases. >=, <=, !=, and == all become one syntactic element when reading, and in practice I have no trouble typing them. And they are especially nice in closures and lambdas.
But what if say you’re reading some code in OCaml with <> or Fortran with .NE. and /= While those would probably not be ligatured, if they were it could be super confusing. I agree that there’s a certain elegance to the look, the ergonomics of not knowing what was typed to create something means you could conceivably half erase something and not know how to retype it.
As an Emacs user, it sounds like everything prettify-symbols-mode does. Is there any real benefit, giving that one seems to give up dynamic reprogrammability, that ligatures have to offer?
For reference, vim has something similar called conceal that people use for rendering latex in unicode and so on.
I haven’t used prettify-symbols-mode specifically, so this may not apply, but when I tried similar things in the past, the problem was that it was generally replacing two or three characters with one character, meaning that either it messed with alignment, or it had to try and do weird things like surrounding the symbol with two half-width spaces.
Personally, I use the Hasklig font, and find that the ligatures look good, but it’s also unobtrusive enough that I just set it as my terminal font (I use Konsole, which supports ligatures) and use it everywhere, rather than trying to only use it with certain files (When I’m using a GUI editor or IDE, I usually use Hasklig as my font there too).
giving that one seems to give up dynamic reprogrammability
giving that one seems to give up dynamic reprogrammability
Can you expand on this? As I understand it, nothing is changing in the actual textual content when using ligatures, so I’m not sure what you’re referring to.
Is it just in comparison to prettify-symbols-mode where you create your own mappings?
My understanding is that you can’t (easily?) turn specific mappings or as you say add ones by manipulating a variable (i.e. dynamically reprogramming), but it’s kind of “set” in the font.
Ah, I see, thank you.
I had never considered changing ligature mappings dynamically, though the fact that this release has different ligature sets for different languages presents a usecase I hadn’t thought of before.
I wonder if doing these mappings in opentype rendering vs in the “editorspace” so to speak would make a difference performance-wise, sort of like what’s happened recently with bringing linum-mode into C.
I hadn’t run across prettify-symbols-mode, thanks for mentioning it! I’ll take a look at it.
Ligatures in code listings sound like a nightmare to me.
Is it just a display thing? I.e. my code has “>=” while I see ‘≥’ in the editor? 
That’s right. In editors like Sublime or VSCode, you can turn off ligatures if you don’t like them; in the case of Iosevka, you can also download a version that does not have ligatures (the term variant).
Yeah it’s just that, your code still lives on disk as >= but the font does a ligature like it might do with fine or flare (the fi and fl merging) in a wysiwyg word processor. The difference is fine and flare still preserve the 2 characters visually, many of these ligatures toss them completely and sometimes go from 2 fixed width chars to 1 which makes alignment a bit strange as well. Though in some cases it could be much nicer.
That is so weird, I opened an issue 5 days ago asking about variable width, and I couldn’t find any discussion about it whatsoever. Then suddenly I see it on the frontpage of lobsters.
Wish the proportional variants were available for inspection somewhere (the web page or the specimen). I’ve been enjoying using another “designed for code” proportional font in emacs lately, and it’s really surprisingly good. The variable width makes it much more humane, but it’s not too variable, so it doesn’t look weird in a code buffer like, say, DejaVu Sans would.
Here’s a look: https://imgur.com/a/hSeO38h
The proportional l looks too thin to me. I use Dina because I need a pixel font for sharp rendering
Ta. I actually just went ahead and installed it to try it. On my (Windows) system it looks a lot more narrow than your sample, but I’m giving it a shot for today.
Completely unrelated but this is a beautiful Emacs theme. It’s so hard to find a nice light-background one.
This is doom-one-light and it’s a great theme indeed. There’s also a dark variant.
Looks like Solarized Light to me!
another one insisting 0 is Ø sigh
Actually you can pick wether you want to use crossed zero or dotted zero.
Oh.. didn’t notice that!
This looks like a cool project, with all the customizability, and different character variants, and all.
However, I’ve used bitmap Terminus (at 9px, on a big-enough screen) for many years, and nothing’s ever looked as clear and legible to me, even though I have been on the lookout for a good coder’s font, and have kept an open mind, being willing to try new fonts. Sadly, you can’t display bitmap Terminus on every system. Some systems can only render it not-bitmap (“smooth”), which ruins it.
If you are willing to try new bitmap fonts, you might find Spleen interesting: https://github.com/fcambus/spleen
Iosevka Term Slab is just superb. I’ve made my own monospace font (DaddyTimeMono) that I’m pretty satisfied with, but for practical purposes, Iosevka still blows it away.
SF Mono is all I need.