Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBM Plex Mono: support programming ligatures #63

Closed
glebd opened this issue Nov 9, 2017 · 30 comments
Closed

IBM Plex Mono: support programming ligatures #63

glebd opened this issue Nov 9, 2017 · 30 comments

Comments

@glebd
Copy link

glebd commented Nov 9, 2017

It would be fantastic if the mono variant eventually supported programming ligatures, like Fira Code, Hasklig, Monoid, etc. I imagine it's not the top priority but ligatures would make IBM Plex Mono an even better coding font. Thanks for a great font collection!

@glebd glebd mentioned this issue Nov 13, 2017
@ctwise
Copy link

ctwise commented Nov 13, 2017

Some examples from other programming fonts: https://www.hanselman.com/blog/MonospacedProgrammingFontsWithLigatures.aspx

A list from Hasklig: <* <*> <+> <$> *** <| |> <|> !! || === ==> <<< >>> <> +++ <- -> => >> << >>= =<< .. ... :: -< >- -<< >>- ++ /= == ->>, :::, >=>, <=<, <=>, <->

@BoldMonday
Copy link
Collaborator

There is one problem with adding these kinds of ligatures to Plex Mono though, and that is that the font will not be 100% monospaced anymore. In order to make monospaced fonts work in certain environments (such as terminal applications) it is necessary that:
a) the font identifies itself as monospaced in the font info;
b) all glyphs are exactly the same width.
If this is not the case, rendering of these fonts can become distorted.

@tonyarnold
Copy link

@BoldMonday so you're saying that fonts like Fira Code are not actually monospaced? If so, I can't tell the difference in use.

@ctwise
Copy link

ctwise commented Nov 14, 2017

That's not how the ligatures in a monospaced font work. They take the same space.
untitled-4 2017-11-13 19-10-12

@davelab6
Copy link

davelab6 commented Nov 14, 2017 via email

@BoldMonday
Copy link
Collaborator

BoldMonday commented Nov 14, 2017

My point is a different one. I know it is possible to make a font with ligatures look like it is monospaced (such as Fira Code).

But even when spacing of ligatures are multiples of the standard advance width, then still the font will not be monospaced anymore by definition. And there are certain environments that expect every glyph in the font to have the same advance width, or otherwise will render the font in unpredictable ways. I have seen this happen in OS X Terminal when customers reported bugs about one of our other monospaced fonts.

@davelab6
Copy link

davelab6 commented Nov 14, 2017 via email

@davelab6
Copy link

davelab6 commented Nov 14, 2017 via email

@tonyarnold
Copy link

I just use Compose+-+> to input it

"Just". That's a fair few more characters than ->, and more importantly, no longer valid in the programming contexts where it would be used/appear. It's not equivalent.

The 80s just called and wants its font hacks back.

Wow, really? 😕 Can we keep this conversation polite, please?

In my experience, ligatures can make functional programming operators easier to understand - Fira Code is linked earlier in this thread - it shows plenty of helpful examples in their repository readme.

You might feel this is some violation of OpenType good practice, but the request stands. Thankfully it's up to the maintainers whether this is something they feel would be valuable to add.

@fabrizioschiavi
Copy link

After my long experience with PragmataPro typeface I can confirm that adding “ligatures” don’t change monospaced spacing and ID. Almost all the text editors will consider the fonts as monospaced.
The important is to keep the same spacing and use CALT feature to programming the “ligatures”
schema

@twardoch
Copy link

@BoldMonday Correction: most monospace fonts contain glyphs that are either of the same width or of zero width. For example, Consolas that ships with Windows 10 includes several glyphs with the advance width of 0, for U+000D (CR), U+200C (ZWNJ), U+200D (ZWJ), U+200E (LTR) and U+200F (RTL). Courier New contains one zero-width glyph. Apple’s Menlo and Andale Mono have the NULL glyph of zero width, though SF Mono has it of standard width.

It is worth noting, however, that those of the OS-bundled monospace fonts that contain combining mark glyphs, have them sit on the standard width, and their width is being zeroed during the GPOS processing.

@twardoch
Copy link

twardoch commented Nov 15, 2017

BTW, the technique of changing the glyph’s advance width in GPOS processing has been used by some font vendors to make monospace glyphs with "wide ligatures". Those wide ligatures have the standard width, then a GSUB OpenType layout feature substitutes a glyph sequence with such a ligature, and then a GPOS layout feature adjusts the width of the ligature to be of double or triple standard width. This way, system-level font filtering algorithms won't reject the font as non-monospace (since all glyphs do have the same width), old software that does not do any OTL processing will not use the ligatures, and modern software that does OTL processing will deal with the multi-width ligatures.

Note: I'm not advocating that you should include these ligatures in Plex Mono in the first place. :)

@moyogo
Copy link

moyogo commented Nov 15, 2017

Using the GPOS processing to change glyphs’ advance width is necessary for zero-width characters such as combining marks.

@glebd
Copy link
Author

glebd commented Nov 16, 2017

PragmataPro is my default coding font, and I like the ligatures in it very much. There is PragmataPro Mono variant without ligatures for programs that are picky about truly monospaced fonts. But most IDEs and text editors nowadays support fonts with ligatures (VS, IntelliJ-based IDEs, Sublime Text, Atom etc.) and that makes the code so much nicer to look at. I sincerely hope IBM Plex Mono has ligatures one day.

@Down10
Copy link

Down10 commented Nov 19, 2017

I would advise against this. While display of code that is "nicer to look at" is an admirable goal, the purpose of code, as a communicable language, is to use a recognizable character encoding that can be seen and retyped from a regular keyboard using a standard set of characters (in most cases, US-ASCII). Fonts like Fira Code breech this standard in ligatures in order to present code in a more pleasing and less rigid display, but at the price of obscuring the actual, er, code.

Frankly, there is no real need for the basic version of the Mono typeface to include these ligatures, as it already displays the ASCII table just fine. The coding ligatures included in Fira Code don't serve any enhancement purpose other than aesthetics. If a great demand for coding ligatures necessitates their inclusion, better to fork a customized font into a separate IBM Plex Code project, in order to keep the original font from bloating with additional characters with limited use.

@vikky49
Copy link

vikky49 commented Nov 23, 2017

people wanting ligatures can use this wonderful tool Ligaturizer to patch the Fira code ligatures on to IBM Plex .Thats how I have been using it and it really looks great so far.

ligatures

@seejamescode
Copy link
Contributor

Looks like there are community solutions for this one. Thanks to everyone that contributed to the positive discussion.

@glebd
Copy link
Author

glebd commented Nov 27, 2017

Ligaturizer only supports regular and medium non-italic variants because that's what is available in Fira Code where the ligatures come from. While certainly useful, it's far from a proper multi-weight mulit-style ligature-enabled font.

@jonathonf
Copy link

Just to confirm, Ligaturizer is Python 2-only and so isn't compatible with various Linux distros (e.g. Arch) and anywhere Python 3 is default. And as @glebd says, it doesn't provide a complete solution.

Please consider re-opening; the typeface itself is lovely, ligatures would be icing.

@Dinjoralo
Copy link

The proposed solution of using Ligaturizer to add Fira Code's ligatures to IBM Plex results in the new font having degraded rendering.
image

@vikky49
Copy link

vikky49 commented Jan 30, 2018

@Dinjoralo There is an updated version of Ligaturizer which i have personally patched and uploaded here
Please try to download the version from there and see if it works

https://github.com/vikky49/patchedFonts-Ligatures

@jonathonf
Copy link

There is an updated version of Ligaturizer which i have personally patched

@vikky49 Did you send your patch(es) upstream? I'm sure a PR would be welcome. ;)

@alinnert
Copy link

I totally understand the argument about Plex Mono being a real monospaced font. I wonder, why not "forking" "Plex Mono" into a new font variant called "Plex Code" which is a copy of "Plex Mono", but with coding ligatures. Similar to how the names "Fira Mono" and "Fira Code" work. Those who don't like ligatures still can use Plex Mono.

When it comes to which ligatures to use, I'd suggest using the same as "Fira Code" (or a subset) because they seem to have the most experience with what works and what doesn't - quite a few ligatures have been removed again because they caused trouble in certain circumstances. I.e. those can be ruled out.

@gibfahn
Copy link

gibfahn commented Nov 12, 2019

Worth noting that Ligaturizer (mentioned above) now has prebuilt Ligaturized versions of Plex Mono in its releases.

LigalexMono-Bold.ttf
LigalexMono-BoldItalic.ttf
LigalexMono-ExtraLight.ttf
LigalexMono-ExtraLightItalic.ttf
LigalexMono-Italic.ttf
LigalexMono-Light.ttf
LigalexMono-LightItalic.ttf
LigalexMono-Medium.ttf
LigalexMono-MediumItalic.ttf
LigalexMono-SemiBold.ttf
LigalexMono-SemiBoldItalic.ttf
LigalexMono-Text.ttf
LigalexMono-TextItalic.ttf
LigalexMono-Thin.ttf
LigalexMono-ThinItalic.ttf
LigalexMono.ttf

It would still be nice to have proper Plex ligatures (rather than the Fira Code ones stuck into this font, but these are a decent workaround.

@vsnthdev
Copy link

vsnthdev commented Jan 6, 2020

I wonder why @alinnert's solution can't be a real thing. I guess the maintainers just don't want to add programming ligatures. And no-one else wants to fork this font and add custom programming ligatures.

@pkazmier
Copy link

Dear Santa Claus 🎅,

All I want for Christmas is an IBM Plex Mono variant with ligatures. Plex Mono is such a beautiful, high-quality font—easily my favorite these days. The only reason I flirt with other fonts is that I miss the ligatures. And while I know ligatures are a polarizing topic, maybe the elves 🧝‍♂️🧝‍♀️ would consider a second version called IBM Plex Code, so I can have the option of a both.

🍪 🍪 🍪 🥛

Yours truly,
Pete

@kjetil-kilhavn
Copy link

kjetil-kilhavn commented Nov 5, 2021

Show me a keyboard with → on it ;)

Pressing AltGr + i to get → is failry standard I believe, at least on Linux. And who cares about other operating systems? :-D

@stickyburn
Copy link

You can also grab a 'nerd font' patched version of this, available here

@AjayChambers
Copy link

Another option is JetBrains Mono. Originally I didn't like it, but now it isn't nearly as bold, and the italics use glyphs that look very similar to IBM's Plex Mono. From my perspective, many of the glyphs were inspired by IBM Plex mono. The way the italic glyphs bend at sharp 45 / 22.5 degree angles, (plex mono italics bend like a 'V' or 'v', rather than like a 'u' 'U'), that's my favorite part of the IBM Plex Mono font. JetBrains has Updated many of its italic glyphs to look the same way.

@AjayChambers
Copy link

Oh, and the whole point I was making was that JetBrains Mono has some of the best ligature support of any font. Also I read above that ligatures cannot be implemented in a monospace font, which, consequently, makes fonts with ligatures unable to render in the terminal.... ummm... NOT TRUE. Many terminals support the rendering of ligatures, and they still only allow monospace fonts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests