Sublime Forum

How do I enable ligatures for the Hasklig font?

#1

Ligatures work fine with Fira Code, but not with Hasklig. Do I have to turn on some specific setting?

I’m on a mac, and install the font with homebrew:

brew tap fonts
brew cask install font-hasklig
0 Likes

#2

Ligatures are displayed automatically if they are provided by the selected font.

With Hasklig V1.1 from https://github.com/i-tu/Hasklig/ ligatures are displayed in ST 3161.

0 Likes

#3

I just reinstalled the font, and now it works. Thanks!

0 Likes

#4

I might have been a bit quick to conclude that it’s working, because now it isn’t working again… I suspect that I might have seen Fire Code working, since I kept switching between it and Hasklig, while trying out other font options.

I expect Hasklig to render <= as , just like Fire Code does… is this expectation wrong?

ST version: Build 3162.
Using MacOS High Sierra 10.13.3.

0 Likes

#5

I added some docs at https://www.sublimetext.com/docs/3/ligatures.html about ligatures. Perhaps they will help some?

0 Likes

#6

BTW, the subpixel_antialias is a Windows-only option that only comes in to play when ClearType is disabled at the system level. Is doesn’t do anything on Mac or Linux.

0 Likes

#7

Thanks for the reply, but I’m still stuck.

ST is on the list of editors which should work in the Hasklig repository, so I’ve opened an issue at the repo, hoping for someone with detailed knowledge about to font to respond.

About the font options, I seem to remember that there were some mac-specific font settings as well, but they seem to be gone from the current versions of the settings?

0 Likes

#8

have you checked the ST console to prove its not having trouble loading the font?

0 Likes

#9

I think the issue is that Hasklig doesn’t have a ligature for <=. I just installed it and << works, and so does <=< (depending on the syntax you use). https://github.com/i-tu/Hasklig doesn’t mention anything about a ligature for <=.

0 Likes

#10

Oh, you’re absolutely right… seems like a weird ligature to not implement though :confused:

EDIT: There’s even an issue asking for the maintainer to create the missing ligatures.

0 Likes

#11

Note for future self: some font supporting ligatures like Hasklig or Fira Code are sometimes released in light version that don’t include ligatures. So if ST doesn’t show them you can try to find another source for the font.

0 Likes

#12

To elaborate a bit, sharing what I’ve stumbled upon trying to solve this issue: Hasklig seems to not include the ligatures which I tested for, because the font is intended for use with Haskell, which apparently doesn’t use those characters?

There’s a version of Fire Code without the ligatures, and it’s call Fire Mono.

But yearh, it’s probably a good idea to not assume that a all versions of a font with ligatures contains said ligatures.

0 Likes