kiliman / operator-mono-lig

Add ligatures to Operator Mono similar to Fira Code
MIT License
3.2k stars 202 forks source link

Create `::` ligature #177

Closed luciascarlet closed 8 months ago

luciascarlet commented 2 years ago

Request preferences

Ligature description

A lot of ligature fonts have a ligature for :: where the colons are just slightly closer together. I find that this really helps readability for C++ and Rust code, where it's used for namespacing, and it's also nice in some functional languages that use it as an operator such as F#. It shouldn't be that difficult to create, but unfortunately I have no idea how to create a new ligature for this myself in Glyphs, so I'm requesting it here. Here are some screenshots demonstrating this ligature in other fonts (first screenshot is Operator Mono SSm Lig, which does not feature it)

Operator Mono SSm Lig Recursive Code JetBrains Mono PragmataPro Cascadia Code Fira Code

Ligature variations

Due to how development is handled, not all ligatures are created at the same time. However, we will get to them all eventually. If you would like to help us develop ligatures, please reach out to us via email at kiliman@gmail.com

Operator Mono

Operator Mono SSm

dannymcgee commented 2 years ago

I write a lot of Rust and C++, so I made this myself in a local fork. (I don't have a Mac or I would have offered to contribute it.)

@kiliman If it's useful at all, here's my glyph definition for Medium SSm:

<Glyph name="colon_colon.liga" lsb="-291" width="625">
  <CharString name="colon_colon.liga">
    0 155 201 156 hstem
    226 169 -161 168 vstem
    -113 356 rmoveto
    2 156 rlineto
    -168 hlineto
    -2 -156 rlineto
    411 hmoveto
    168 hlineto
    2 156 rlineto
    -168 hlineto
    -12 -512 rmoveto
    169 hlineto
    5 155 rlineto
    -169 hlineto
    -247 -155 rmoveto
    5 155 rlineto
    -169 hlineto
    -5 -155 rlineto
    endchar
  </CharString>
</Glyph>

I didn't make an italic version or any other weights out of sheer laziness lol. Here's what it looks like:

colon_colon_lig

kiliman commented 2 years ago

@dannymcgee Nice. How did you manage to create the glyph without the Glyphs app?

dannymcgee commented 2 years ago

@dannymcgee Nice. How did you manage to create the glyph without the Glyphs app?

It's been a little while so I honestly don't remember the exact steps, but I used a trial version of FontLab 6 to do the actual editing. From there, I exported the modified font to OTF, used one of the commands in this repo to convert to TTX, and IIRC I just manually hunted through the TTX file to find the correct attributes and created a new XML file matching the format of the others. Not really the most elegant workflow lol, but it did the trick.

kiliman commented 2 years ago

@dannymcgee Ha. Impressive 👏

It's been a while since I've updated the ligatures, so I'll see if I can block out some time this weekend and work on some of the requests.

luciascarlet commented 2 years ago

@dannymcgee Off-topic, but what syntax theme is that? Looks like a variation of Palenight but with more violet keywords, I dig it.

dannymcgee commented 2 years ago

@dannymcgee Off-topic, but what syntax theme is that? Looks like a variation of Palenight but with more violet keywords, I dig it.

Thanks! It's actually my own: https://marketplace.visualstudio.com/items?itemName=dannymcgee.summer-vacation-theme

luciascarlet commented 2 years ago

@dannymcgee Oh that looks great, I've actually been working on a custom one myself (Letty) but it's currently only fully implemented in Xcode. I will say this though, bless you for making a matching light theme; not enough themes do this and as someone who uses both light and dark mode depending on daytime I really appreciate that. (This was one of the key design goals for my theme)

kiliman commented 2 years ago

I use Cobalt2 by Web Bos. He's the one that got me hooked on Operator Mono. It looks great with ligatures

image

dannymcgee commented 2 years ago

@kiliman Ha, seeing your screenshots here actually inspired me to use blue instead of gray for doc comments. Cobalt2 is really nice.

kiliman commented 2 years ago

Yeah, dark themes don't all have be shades of gray. That's why I prefer Twitter's dark mode over GitHub's. I actually use an extension called Stylus, so I can theme code on GitHub with Cobalt2.

Actual screenshot from GitHub image