source-foundry / Hack

A typeface designed for source code
http://sourcefoundry.org/hack/
Other
16.33k stars 608 forks source link

Hasklig style ligatures #35

Open i-am-the-slime opened 8 years ago

i-am-the-slime commented 8 years ago

This'd be so cool: https://github.com/i-tu/Hasklig

Brantron commented 7 years ago

Is there a link for the new font?

chrissimpkins commented 7 years ago

see @ignatov post below

Hi all, I've just spent several hours tonight and create ligatures for == and != for Hack Regular. I'm going to add more of them, but the issue is that I'm using Glyphs not FontLab. @chrissimpkins Could you please give me a piece of advice how to contribute to the main repo with FontLab VI.

Please see https://www.dropbox.com/s/owzd20463aqc40a/Hack-Normal.ttf?dl=0

skbolton commented 7 years ago

Any progress on the ligatures?

ignatov commented 7 years ago

I haven't done anything since summer :–)

skbolton commented 7 years ago

Still hoping this comes around at some point

ignatov commented 7 years ago

Hi guys, I've just forked the Hack repo and created a prototype with several ligatures. Feel free to use it. https://github.com/ignatov/Haack/ Your feedback is highly appreciated!

chrissimpkins commented 7 years ago

Response to @ignatov by email for request about build technique for Hack font files:

Sergey-

There is not a fully automated process to build Hack.

For ttf files (recommended for use across all platforms), I built with FontLab V as “pre-hinted” ttf build files, then used our ttfautohint based scripted hinting approach that is contained in the following script file:

https://github.com/chrissimpkins/Hack/blob/master/postbuild_processing/tt-hinting/autohint.sh

This uses hinting settings that are defined in the -TA- files in this directory:

https://github.com/chrissimpkins/Hack/tree/master/postbuild_processing/tt-hinting

These files apply optimized hinting to the main character set files that are used in code. We never ran through optimizations for extended character sets that were not commonly used in code because this was not our goal. If you replicate this approach, you will get hinting in your new ligature characters (ttfautohint hints all characters in the set) but you may need to tweak these if you find that they do not look as intended at certain glyph sizes.

For otf files, the build files are hinted with the built in otf hinting used in FontLab V. You will get good automated hinting of otf files in Glyphs as well (probably better c/w FontLab).

On OS X, the hinting is automated by the operating system and hints are ignored. TTF and OTF files should both look similar and good.

For Windows and Linux, the hints really, really matter (see a large number of the closed issue reports) and I suggest that you investigate how your new glyphs appear at a range of sizes commonly used in code editors if you are targeting these platforms.

Feel free to get in touch if there is anything that you need. Best of luck with the fork! There have been a large number of requests for ligatures. My goal was to create a typeface that could be used as a general face for code anywhere (including textbooks, websites, etc) and the ligature approach was not what I wanted for the main face. It will be a great tool for a “working” typeface intended to be used in editors for individuals who are working on code.

cvharris commented 7 years ago

I tried out Firacode just to checkout ligatures and, although the ligatures are there and good, the rest of the font is not great. I have always loved Hack's attention to detail. Can't wait to see the progress @ignatov makes on Haack!

ralgozino commented 7 years ago

First, let me say that I love the Hack font, Thank you! But lately I've been using Fira Code only for the ligatures. Just came to propose Hack Code as the name for the Hack + ligatures font alternative! :wink:

chrissimpkins commented 7 years ago

@ralgozino Thanks for the note Ramiro! Pinging @ignatov on this. You can find his fork where he is including programming ligatures here:

https://github.com/ignatov/Haack

chrissimpkins commented 7 years ago

@ignatov Sergey, as a side note we are working on a new build and testing chain for Hack that will be fully scripted to eliminate editor dependencies. I am hoping that this simplifies contributions here, provides tinkerers with an approach that allows them to modify fonts for themselves, and that all downstream forks will be able to take advantage of it. Keep an eye on the repo for updates as we move in this direction. Work in progress. It will be released as v3.0 of the fonts.

ignatov commented 7 years ago

That's cool, are you still using FontLab for editing? Is it possible to use an open sourced or at least free editor for contributing?

chrissimpkins commented 7 years ago

@ignatov Yes, I have used FontLab Studio V for most of the editing work in v2.x. The goal will be to support contributions with any editor (including command line editing tools) that can modify UFO source. We are creating the build tool chain directly from the UFO source files with libre OS build software. We are also working on a testing approach with a goal to include a combination of source text file diffs, opentype table error detection, and visual diffs of modified glyphs with each commit. The maturity of OS testing software out there has reached a stage where it seems feasible to begin to implement this. Possibly in a CI testing form, possibly manual.

cc: @burodepeper @spstarr

chrissimpkins commented 6 years ago

@ignatov

Sergey, following the upcoming v3.0 release, I would like to give some attention to a Hack fork that includes source code ligatures. We are modifying the license with v3.0 so that Hack can be used in the name of fonts in any fork (i.e. the reserved font name is going away) if this is of any interest to you. This suggestion was included in a post in this thread (believe someone suggested "Hack Code"). Since you have an existing ligature fork, I wanted to see if this is something that you intend to continue to develop and maintain. If so, this would be extremely helpful (to both me and to those who want ligatures in the Hack sets) and I am more than willing to pitch in to transition your repository to the upstream build tooling so that you can stay current with upstream (non-ligature glyph) changes and build with the same approach that we are using. It will significantly simplify contributions from others so that you can attract contributions of ligature glyphs to your fork (we've added UFO source CI linting, CI build testing on OS X and Linux via Travis, scripted / automated builds from UFO source - including desktop/webfont/webfont subsets, new versioning application that will git sha1 short code stamp font builds, new UFO source diff tool, and more as part of this upcoming v3.0 release). The license transition is (in part and in addition to the removal of the Hack reserved font name) intended to support DFSG and other FLOSS build guidelines so that you will be able to release this font fork on Debian/Ubuntu and other distros that provide build from source guidelines for fonts. Our upstream build tooling (and all dependencies of the build tools...ugh!) is already under review by both Debian and Fedora so this work will be done down the road for anyone who wants to fork the v3.0+ source and release on these distros with the upstream build tool chain.

Let me know if this is something that you have the time/interest in at this point. All build tools are more or less in place in non-master branches and work can begin at any time that this is convenient for you.

For others with an interest in source code ligatures with the Hack upstream sets, I would encourage you to grab a free open source font editor that supports UFO source code and start drawing what you like off of Hack base glyphs in UFO source! The inclusion of these commits will not be difficult via standard Github PR approach in any repository that forks off of our v3.0 source and build scripts.

Let's make this happen.

chrissimpkins commented 6 years ago

@chriskrycho has pounded a flag in the ground on this one (possibly...)! I will start working on a guide for derivatives that details how we add/remove/modify glyphs, build, hint, perform other post-compile modifications, and create our release archives. I am more than willing to pitch in on actual work wherever I am helpful. It will be useful to us to use this as a project to understand how we can be most helpful upstream with commits in order to allow downstreams to cherry pick what they want from the changes here. We may need to update our workflow (and contributing documentation) a bit to make sure that design changes in the source are included as commits without repository changes outside of the source.

It would be helpful for all of those in this thread with an interest in this to start combing your source for ligature targets and maintain a list that includes code point 1 + code point 2 = ligature shape. The more visual you can make the ligature shape examples the better.

chrissimpkins commented 6 years ago

@chriskrycho still something that you want to do?

chriskrycho commented 6 years ago

Want? Very much yes. Time? Sadly, my other commitments are higher right now than I knew. If others want to pick it up, they should; I will not in the least be offended. If you write that guide, maybe I'll be able to get to it in December or, more likely, January–February time-frame.

chriskrycho commented 6 years ago

@chrissimpkins do you have a place you want a list of specific code points to go? I can at a minimum start throwing those together for you, based on my experience using Hack (and Haack) day to day right now.

chrissimpkins commented 6 years ago

@chriskrycho probably be best to place it on the repository for the ligature project.

How's this for a thought to get things off the ground?

This assumes the following:

Thoughts?

I can make the repo and get things moving with this if there is interest in lending a hand.

chriskrycho commented 6 years ago

Strategy sounds broadly correct, and it should be straightforward enough to tweak that strategy (e.g. including more-than-ASCII if necessary) should more data/different use cases emerge.

The one thing I'm unsure about is the fallback font approach. A few notes that way:

chrissimpkins commented 6 years ago

@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.

chriskrycho commented 6 years ago

As far as I can tell, Haack had one release and then the author went completely silent. Alas!

chrissimpkins commented 6 years ago

OK we will revive this. Thanks Chris.

vikky49 commented 6 years ago

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

image
ignatov commented 6 years ago

@vikky49 Cool, could you please provide binaries?

chrissimpkins commented 6 years ago

Looks like perhaps they do for regular set only?

https://github.com/rojiani/Ligaturizer/blob/master/output-fonts/Hack.ttf

chrissimpkins commented 6 years ago

@vikky49 worth pushing a repo with those ligature patches and keeping this current with the Hack upstream?

vikky49 commented 6 years ago

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

chrissimpkins commented 6 years ago

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?

vikky49 commented 6 years ago

@ignatov and @chrissimpkins Here you go ..My version of modified ligatures over the https://github.com/rojiani/Ligaturizer/blob/master/output-fonts/Hack.ttf

My Version of ligatures binary can be found here

https://www.dropbox.com/s/682w2cb8p0d018h/Hack.ttf?dl=0

vikky49 commented 6 years ago

@chrissimpkins sure .Will host all these changes into my repository some time this week and post the link

chrissimpkins commented 6 years ago

@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.

vikky49 commented 6 years ago

@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

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

chrissimpkins commented 6 years ago

@vikky49 thanks! Willing to open the scripting that you used to accomplish this so that others can examine & replicate it?

vikky49 commented 6 years ago

@chrissimpkins If u mean by the modifications of ligatures that i did ,, sure i can open put it up in a repo

chrissimpkins commented 6 years ago

@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?

chrissimpkins commented 6 years ago

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)

https://github.com/chrissimpkins/fontname.py

pyrho commented 5 years ago

For those interested I've "patched" @vikky49's ligatured version with nerdfont (powerline glyphs, dev icons etc.). You can find it here !

chrissimpkins commented 5 years ago

@pyrho ty!

bensleveritt commented 5 years ago

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.

bensleveritt commented 5 years ago

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.

Thesola10 commented 5 years ago

@bensleveritt

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.

chrissimpkins commented 5 years ago

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.

soetz commented 5 years ago

@chrissimpkins

I'd LOVE to (try to) do it ! Problem being I've never designed/made/coded fonts before. Do you have any resources so that I could learn how to use all the tools needed for this ?

joshmcarthur commented 4 years ago

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:

  1. If Ligaturizer was added as a tool available to the build process of this project, it could prepare a variant of the Hack font with ligatures added as part of the release (Ligaturizer just needs to be pointed at TTF files and can automatically prefix the font name - e.g. Liga Hack, Hack Code, etc, or rename it entirely - e.g. LigaHack)
  2. This project could pull in the pre-built font files from the Ligaturizer releases page. This is probably problematic since the font is probably quite out of date by the time it makes its way through the Hack -> Codeface -> Ligaturizer repos and build processes - but it's an option
  3. The README and/or other documentation could be updated to direct potential users to the release of Ligaturizer that includes the variant of Hack.
vikky49 commented 4 years ago

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

joshmcarthur commented 4 years ago

@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

gaplo917 commented 4 years ago

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:

  1. If Ligaturizer was added as a tool available to the build process of this project, it could prepare a variant of the Hack font with ligatures added as part of the release (Ligaturizer just needs to be pointed at TTF files and can automatically prefix the font name - e.g. Liga Hack, Hack Code, etc, or rename it entirely - e.g. LigaHack)
  2. This project could pull in the pre-built font files from the Ligaturizer releases page. This is probably problematic since the font is probably quite out of date by the time it makes its way through the Hack -> Codeface -> Ligaturizer repos and build processes - but it's an option
  3. The README and/or other documentation could be updated to direct potential users to the release of Ligaturizer that includes the variant of Hack.

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.

astrolemonade commented 4 years ago

@vikky49 what are the names of the IDE and theme from the screenshot above ?

rofrol commented 2 years ago

@gaplo917 Ligaturizer works with latest Hack.

image