-
-
Notifications
You must be signed in to change notification settings - Fork 615
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
Hasklig style ligatures #35
Comments
Agreed, was the first thing I looked for in this project. |
I'm looking for that too. But not only for Haskell related ligatures (a big part of Hasklig ligatures are Haskell specifics), but for more general programming ligatures as available in FiraCode who have a lot of ligatures available, and a big part of them are common programming symbols. |
For those who aren't aware of ligatures in source code typefaces, see the Fira Code site which has a nice set of images that show the ligatures compared to the actual glyph combinations. I have been torn on the standard ligature issue. While it works very well in circumstances when you are working in an editor with the typeface and know that the ligatures are present, it misinforms readers when the typeface is used to display source code to others (print, websites, presentations, embedded in pdf's, embedded in applications). You can imagine a scenario where a developer who is new to a language attempts to use a Unicode leftwards arrow The OpenType discretionary ligature feature (off by default, explicitly activated) would be ideal, but it isn't supported by any desktop source code editor to my knowledge so it would not address your request. On the web side, the CSS3 spec includes support for them, but I do not believe that this is widely supported by browsers at the moment either. This does not appear to be a good approach for now. This would be a great feature for a working font designed for a select group of developers and I think it would warrant a separate build from the general purpose main branch of Hack to support it. My understanding from the Fira Code and Hasklig documentation is that standard ligature support is spotty at best across current versions of commonly used text editors. I guess this begs the question whether this is worth the effort until that situation changes. |
For editors in Java (like IntelliJ), the OpenJDK have a bug who prevents from rendering ligatures. An issue on the JetBrains bug tracker (https://youtrack.jetbrains.com/issue/IDEA-127539) have been opened to support ligatures into the IDE and a guy from JetBrains has reported the bug to the JDK team. Currently, I only know 3 OS fonts who provide ligatures for coding + Pragma Pro. It could be a good feature in your font, especially because it's a coding font. Having a separated branch is a good idea or the possibility to customize the font (as with Monoid) could be a good idea, with a warning to suggest users to not use ligatures in their articles. |
@chrissimpkins I agree pretty much tit for tat with your analysis here. This can be great for somebody that know exactly what was going on but is a probable source of trouble for anybody unfamiliar with both the programming language and the font features involved. In other worse it would be nice to have but only in the context of an off-by-default feature. The only thing I can really add is that browser support for CSS3 features that enable alternate ligature sets and other OpenType features is actually pretty broad already and can be used in most scenarios. That's a viable way of providing the feature not only on the web but in a lot of editors that are browser based. Some of them are buggy at the moment but I don't think it will be long before accessing alternate ligatures is viable in a lot of editors. Terminal based editors (where I live) are another matter. It might take a second version of the font to make that viable at all. |
I also agree with the original poster of this issue for ligatures to be supported. Regarding the thread about the usefulness of ligatures @chrissimpkins @alerque has started, ligatures are a no brainer to have on by default as ligature by definition enables *monospace *typeface to better communicate the intent of two or more characters than they could by themselves. In the context of code, enable better understanding of the intent of the code Being a monospace font, editors that can't support them should have no problem having Hack being used like any monospace font. In other words, they gracefully degrade. It shouldn't be "off" (efforts that deliberately not allow the ligatures to be used out-of-the-box like any other Openttype typeface) as it would break the principle of least surprise as far as the OS. Editor's often by convention make it a opt-in feature since the developers of editor's may find it worthwhile to accommodate users of a non-monospace typeface that may It's more of a matter of a serious effort be made, more than anything else. If ligatures of a monospace typeface makes the intent of a set of characters in the fixed-width space they occupy more confusing for development (it's a monospace typeface after all), then that typeface has failed the users of that typeface. This feature is extremely important for languages that encourage or enable functional or async programming paradigms as needed for applications often such as Haskell, Swift, Go (esp. CSP), JavaScript, & etc. In 2015, it should increasingly be the norm. |
I'm sorry @lozandier but I don't buy that line of reasoning. Here's why. First, OpenType ligatures being off by default is quite normal. Lots of fonts have a few of the more subtle possible ligatures enabled and many more of the possibly disruptive or unexpected ones off by default and behind discretionary flags. The same goes for stylistic alternative glyphs. Usually the more generic glyph is the default and the fancy-pants ones are behind a discretionary flag. This is normal. Nothing about doing this violates least surprise principles. Second, source code ligatures do not always easily decompose into their component parts. Your typical ligature for Third, for a general purpose font that is not aware of it's context, such ligatures would necessarily b wrong in some contexts. You cannot go wrong with the component glyphs but you can be wrong about when a ligature should be rendered. Maybe a code comment was giving an example from another programming language. Maybe something the character sequence is in the terminal for some reason other than being part of source code. Changing this behavior by default across the board would be frustrating for people that didn't know what was happening or how to fix it because it's not normal behavior. On the other hand folks that knew the language they were coding in and that they wanted to see fancy ligatures should have no problem adding the option flag to their font config. Lastly not all programming languages will be compatible with the some set of ligatures. Whichever ones you enable by default would invariably end up being wrong for some language. On the other hand if you create ligatures and tag them in the appropriate font features table it's possible to create sets that would include all the appropriate ones on a per programming language basis. This would enable power users familiar with a language to enable ligatures for it in their editor for those files without screwing with their minds for languages whose syntax is new to them. I look forward to having ligatures as an option, but think trying to make them on by default would be a huge mistake for a general purpose font even if it make perfect sense for a language specific or specialty font whose primary purpose was to provide this feature for a known scenario, |
I meant attempting to have workaround that would disable them in contexts For editors, they would be turned off by default; it would break the On Mon, Sep 7, 2015 at 4:08 AM, Caleb Maclennan notifications@github.com
Kevin Lozandier |
How about having two versions of the font? Hack and Hæck. So people can choose themselves whether they want Ligatures or not. |
That doesn't seem to be efficient al all, if the ligatures tables can be in Even editors that support ligatures wisely make you opt-in of having them On Sun, Sep 13, 2015 at 6:26 AM, Mark Eibes notifications@github.com
Kevin Lozandier |
Thanks to all for the feedback here. I really like the idea of ligatures with the caveats that I expressed in the thread above. I wanted to provide an update on this issue. I reached out to Tal Lemming (@typesupply) and Ellen Lupton to see if they would be willing to lend their expertise on this and a number of other type design related issues with the project. I think that the concept is great and the question is how we execute this without interfering with the information contained in the source. For the proponents of ligatures, might I ask that you do a bit of research into the breadth of support that there is for these in widely used source code text editors (including for discretionary ligatures) and the level of difficulty that there may, or may not, be with settings to activate or inactivate the ligatures? I know that Andreas Larsen did a bit of work on this for his Monoid project and we can begin by validating and extending the information that he provides in the README on his Github repo. With this information, we can decide whether we need to clamor for more extensive support by the developers of editors and/or improvements in settings / ease of use of settings to take advantage of these OpenType features. This will allow us to have an informed discussion about ligatures in a working font. We can decide from there whether this is more appropriate as a separate build or within the main release. While use as a working font in source code editors is the most common application of the typeface at this point, it is not the only one. We need to take this into consideration with developments that (1) may not be attractive to all groups of users and (2) could limit, or eliminate, its use for other purposes because we force users to either use new features like ligatures or introduce an inconvenience that they must design around to avoid use in cases where this is optional (e.g. the CSS web font examples provided above). This does not exclude the possibility that we could be creative in our design and create something that addresses these concerns. I am very open to more feedback and will continue to keep an eye on the discussion here. |
My two cents, if I may: Hasklig-style ligatures are pretty, but they are by no means intuitive in this context. If a user types two characters on the keyboard, and they suddenly turn into a single character that may or may not actually resemble the two characters put together, it appears as a bug in the font or editor. If a user is learning a new language, and he's reading the docs, and he sees that inequality is written as What if someone wants to search for a symbol? If one is searching for And in this "Unicode age," where nearly every symbol imaginable has an actual code point and character in some system font, how does one know that he's seeing a ligature and not the actual Unicode character? What if someone takes a screenshot and shows it to people who know nothing of these magic ligatures? What if someone sits down at another person's computer and sees these ligatures? They can look very nice, but I'm afraid they are just not a good idea for general use. If the build infrastructure can support a custom build with them, then I'm all for giving people options. And if editors begin to support ligatures, then I'm all for having them in the font as built-in alternatives. But they should definitely not ever be a default feature. To do so would condemn the font to be used by virtually no-one. They are pretty, though. :) |
from @stefan-kern:
|
Atom editor now supports ligatures: |
Atom already did via author style sheet; I've literally used ligatures in On Saturday, October 31, 2015, Chris Simpkins notifications@github.com
Kevin Lozandier |
@lozandier I see. They seemed to push this as news. I don't use Atom. |
I don't use it often either; I primarily use Vim or Webstorm On Saturday, October 31, 2015, Chris Simpkins notifications@github.com
Kevin Lozandier |
+1 |
+1 In response to your request for research, Chris, the FiraCode page on GitHub has a fairly extensive list of editors with and without support for ligatures: https://github.com/tonsky/FiraCode#user-content-editor-support |
@Tbrisbane thank you |
We’re tossing around the idea of starting a branch of Hack that includes ligatures and will serve as “working fonts” for development in text editors. This will be developed in parallel with the main Hack branch, be released under a new font name, and address the mounting interest that you’ve expressed here. For those who are interested in this, will you please chime in again with:
As you work through the above, I’d ask you to also begin to think about the design of the ligatures that you suggest. As this materializes, we will plan to create issue reports for the ligatures where the design can be discussed in much more detail. It will be impossible to meet everyone’s demands / needs, but ideas are extremely helpful and will drive the design as the set matures. Lastly, it would be helpful to have at least one individual with development experience in each language that we define as our supported target languages (see above) who would be willing to commit to testing these during the early, active development phase. Let’s see what we can pull together. Please continue the discussion here for now. |
Hi, The single most important character combination in Scala is There are also some other more general purpose characters which occur in a great many languages: That's all I can think of for now. It got a bit stream of consciousnessy towards the end. Sorry for that. |
+1 haha! I love this. Thanks for all of this information. Look forward to this discussion. |
For me would be important implementing the ligatures the "monoid-way" because like in the Atom 1.1 release notes states this is the only one where it is possible for atom to set the cursor between the two ligature-symbols: http://blog.atom.io/2015/10/29/atom-1-1-is-out.html
|
@chriskrycho thanks Chris. Let's wait for a bit more feedback and can decide if this is an appropriate approach. FWIW, it would be ideal to simply work on Haack but I have not heard back about time/interest there. How recently has that project been updated, is it being maintained current with Hack upstream, and are PR being accepted / merged from contributors? I don't use ligatures so this won't be for my own use, but given the interest out there (and opportunity to create some interesting new glyph shapes which seems like a fun challenge) I am willing to contribute time to this. |
As far as I can tell, Haack had one release and then the author went completely silent. Alas! |
OK we will revive this. Thanks Chris. |
I patched Hack font with ligatures using this https://github.com/rojiani/Ligaturizer and it really looks good. Its a good alternative till Hack has its own ligatures |
@vikky49 Cool, could you please provide binaries? |
Looks like perhaps they do for regular set only? https://github.com/rojiani/Ligaturizer/blob/master/output-fonts/Hack.ttf |
@vikky49 worth pushing a repo with those ligature patches and keeping this current with the Hack upstream? |
sure .I can push my binaries ..but the problem is its based off of Fira Code and FiraCode does not have italics .So at the moment only the regular version has ligatures but so far i did not find it as a problem as 90% of my mainstream code that uses is regular font ..Italics are widely used only for comments and stuff for the work i do.. The original version of the script has very limited ligatures .So I modified the script to have many more that are useful @chrissimpkins to which place do i upload the binary |
Ideally to your own new repository where you can host these changes for others who would like to use the binaries. Mind also posting some images there with what has been implemented so far as source code targeted ligatures? |
@ignatov and @chrissimpkins Here you go ..My version of modified ligatures over the My Version of ligatures binary can be found here |
@chrissimpkins sure .Will host all these changes into my repository some time this week and post the link |
@vikky49 sounds great. Let us know when it is available. We are maintaining a thread of derivatives and will find someplace to link these for users. |
@chrissimpkins @ignatov Now the new Ligaturizer has been updated to support all the variants like Bold , Italic and BoldItalic.. I have patched the Hack font again with the latest fonts and removed some ligatures which look very specific for Fira Code like (&&) . I have uploaded the binaries in my repo ..It can be found here |
@vikky49 thanks! Willing to open the scripting that you used to accomplish this so that others can examine & replicate it? |
@chrissimpkins If u mean by the modifications of ligatures that i did ,, sure i can open put it up in a repo |
@vikky49 that would be helpful too (along with images on your README so that users can see what they are getting with your ligature changes), but I was actually referring to a script that includes how you built the fonts with the Ligaturizer project. Possible to add a shell script / Makefile or some other approach that allows users to understand and compile the patched fonts in the way that you did? |
This font renaming script is available for anyone who would like to install Hack derivatives side-by-side with upstream Hack if there is any use in having both installed (e.g., you are using it outside of work in source text where ligatures do not apply) |
@pyrho ty! |
I'm a little confused about the situation now (I got here after stumbling into hæck today). Is there an 'official' Hack Code? Or is @vikky49's patched font the best course of action? I've tried to follow along, but I can't work out if this issue is still open for 'intent-to-change' or informational purposes only. |
Just to be clear. If an 'official' one is on the cards, I'd be willing to spend some time making it happen. I'm really pleased with Hæck, and I think it's pretty far behind Hack now. I'd love to see what's changed. |
As I understand it, @vikky49 has successfully patched Hack with ligatures extracted from Fira Code, but they have not yet released a script describing their patching process, meaning that the patching process cannot yet be merged into the Hack project, and a ligatured font can't be reliably produced and maintained. |
This is correct. There is no upstream Hack ligature set. @vikky49 patches are available. There are no immediate plans to release source code ligatures in this repository however I would be happy to pitch in on an effort to help make this happen in a derivative if anyone wants to take on the maintainer + design responsibilities for that project. There should be a reasonably straightforward way to merge any design changes here with that downstream repository. There is a lengthy story about my concerns with ligatures detailed very early in this thread. Let me know how I can help support this. It has been in high demand for a long time. I just don't have the cycles to tackle it myself. |
I'd LOVE to (try to) do it ! Problem being I've never designed/made/coded fonts before. |
Along with @vikky49's patches (which are now a little out of date since they were initially generated and then not maintained), I have found that the Ligaturizer project mentioned above (https://github.com/ToxicFrog/Ligaturizer) builds and releases a version of Hack with ligatures added from Fira Code. Ligaturizer builds the Liga Hack font from @chrissimpkins's own codeface project, and publishes to their releases page. While the releases don't appear to be continuously build against codeface@master, there are regular updates, so this is probably a good source if you're not wanting to build the font yourself. In terms of rolling this into this project, I can see three easy-ish options:
|
Sorry..I will soon update all of them again..I have been a bit lazy..I just saw a PR which updates the ligaturizer with the latest Firacode changes.. All the updated fonts should be out in a week |
@vikky49 no pressure! You've made a fantastic contribution for this issue as it is. I just wanted to point out that there's an alternative available if anyone is wanting to quickly grab the release from Ligaturizer |
For those who are looking for Liga Hack v3.003, I can confirm that current Ligaturize is not able to build Hack v3.003. I submitted a pull request to fix that and also created a standalone repository "Ligatured-Hack" which implemented with a fully automated build process to build latest "Liga Hack". I use Travis CI run a daily cron job to check both Hack / Fira code release version. If CI detected a new font release, it will build a new "Liga Hack" release automatically. Latest build can be found in https://github.com/gaplo917/Ligatured-Hack/releases This implementation should be self-maintained that automatically combine latest Hack & Fira ligatures together without any human maintenance 😄. P.S. A warm reminder, the above implementation use Fira code ligature but not Hasklig. |
@vikky49 what are the names of the IDE and theme from the screenshot above ? |
@gaplo917 Ligaturizer works with latest Hack. |
This'd be so cool:
https://github.com/i-tu/Hasklig
The text was updated successfully, but these errors were encountered: