-
Notifications
You must be signed in to change notification settings - Fork 575
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
Comments
Some examples from other programming fonts: https://www.hanselman.com/blog/MonospacedProgrammingFontsWithLigatures.aspx A list from Hasklig: <* <*> <+> <$> *** <| |> <|> !! || === ==> <<< >>> <> +++ <- -> => >> << >>= =<< .. ... :: -< >- -<< >>- ++ /= == ->>, :::, >=>, <=<, <=>, <-> |
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: |
@BoldMonday so you're saying that fonts like Fira Code are not actually monospaced? If so, I can't tell the difference in use. |
The advance width of the ligated glyphs must be an integer multiple of the
typical advance width, but this constraint is possible to work within :)
…On Nov 13, 2017 7:10 PM, "Charles (Ted) Wise" ***@***.***> wrote:
That's not how the ligatures in a monospaced font work. They take the same
space.
[image: untitled-4 2017-11-13 19-10-12]
<https://user-images.githubusercontent.com/5510/32756080-49d8d64a-c8a6-11e7-97bf-023d5eb7a691.png>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#63 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAP9yxuDVFTkNK6f3m7haKJrUhWOuW_Kks5s2Np0gaJpZM4QYvuU>
.
|
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. |
Thanks for clarifying :)
Support in terminal apps varies, but is increasingly globally (especially
as usage of the libre opentype library harfbuzz is accelerating)
https://github.com/tonsky/FiraCode#terminal-support
So yes, supporting non-OpenType environments is a good goal, and riffing on
Fira Mono / Fira Code, having a "Plex Code" family that has the ligatures,
while "Plex Mono" stays a "true monospaced" typeface, would be nice.
|
Show me a keyboard with → on it ;)
|
"Just". That's a fair few more characters than
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. |
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. |
@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. |
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. :) |
Using the GPOS processing to change glyphs’ advance width is necessary for zero-width characters such as combining marks. |
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. |
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. |
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. |
Looks like there are community solutions for this one. Thanks to everyone that contributed to the positive discussion. |
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. |
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 There is an updated version of Ligaturizer which i have personally patched and uploaded here |
@vikky49 Did you send your patch(es) upstream? I'm sure a PR would be welcome. ;) |
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. |
Worth noting that Ligaturizer (mentioned above) now has prebuilt Ligaturized versions of Plex Mono in its releases.
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. |
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. |
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, |
Pressing AltGr + i to get → is failry standard I believe, at least on Linux. And who cares about other operating systems? :-D |
You can also grab a 'nerd font' patched version of this, available here |
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. |
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. |
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!
The text was updated successfully, but these errors were encountered: