1
1
mirror of https://github.com/i-tu/Hasklig.git synced 2024-09-11 10:36:46 +03:00
Hasklig/README.md

138 lines
6.8 KiB
Markdown
Raw Normal View History

2016-07-15 16:51:20 +03:00
_N.B. This is a fork of the_ [Source Code Pro repository](https://github.com/adobe-fonts/source-code-pro)
2015-12-28 23:17:59 +03:00
2015-12-31 18:57:13 +03:00
### Hasklig _Ligatures for code_
2015-12-28 23:17:59 +03:00
Programming languages are limited to relatively few characters. As a result, combined character operators surfaced quite early, such as the widely used arrow (`->`), comprised of a hyphen and greater sign. It looks like an arrow if you know the analogy and squint a bit.
2016-07-15 16:51:20 +03:00
Composite glyphs are problematic in languages such as Haskell which utilize these complicated operators (`=>` `-<` `>>=` etc.) extensively. The readability of such complex code improves with pretty printing. Academic articles featuring Haskell code often use [lhs2tex](https://www.andres-loeh.de/lhs2tex/) to achieve an appealing rendering, but it is of no use when programming.
2015-12-28 23:17:59 +03:00
2019-05-28 10:38:27 +03:00
Some Haskellers have resorted to Unicode symbols (`⇒`, `←` _etc._), which are valid in the <span style="font-variant: small-caps">ghc</span>. However they are one-character-wide and therefore eye-strainingly small. Furthermore, when displayed as substitutes to the underlying multi-character representation, as [vim2hs](https://github.com/dag/vim2hs) does, the characters go out of alignment.
2015-12-28 23:17:59 +03:00
2016-07-15 16:51:20 +03:00
Hasklig solves the problem the way typographers have always solved ill-fitting characters which co-occur often: [ligatures](https://en.wikipedia.org/wiki/Typographic_ligature). The underlying code stays the same — only the representation changes.
2015-12-28 23:17:59 +03:00
Not only can multi-character glyphs be rendered more vividly, other problematic things in monospaced fonts, such as spacing can be corrected.
2017-01-22 13:35:53 +03:00
[**Download Hasklig Font Family v1.1**](https://github.com/i-tu/Hasklig/releases/download/1.1/Hasklig-1.1.zip)
2015-12-28 23:17:59 +03:00
#### Hasklig
![Hasklig Sample](hasklig_example.png?raw=true)
#### Source Code Pro
![Source Code Pro Sample](SourceCodeProSample.png?raw=true)
### Release notes
+ [v1.1](https://github.com/i-tu/Hasklig/releases/tag/1.1)
+ New ligatures `->>`, `:::`, `>=>`, `<=<`, `<=>`, `<->`
+ Switched to newer version of calt code by [Nikita Prokopov](https://github.com/tonsky/FiraCode). It "doesnt apply ligatures to long sequences of chars, e.g. !!!!, >>>>, etc"
+ Fixed `++` and `+++` line inconsistency in heavy italic weights
+ [v1.0](https://github.com/i-tu/Hasklig/releases/tag/1.0)
2017-01-21 19:41:30 +03:00
+ Updates to the latest version of SCP
+ Hasklig moves to a ligature substitution mechanism borrowed from the excellent [Fira Code by Nikita Prokopov](https://github.com/tonsky/FiraCode)
2015-12-31 18:57:13 +03:00
+ [v0.9]((https://github.com/i-tu/Hasklig/releases/download/0.9/Hasklig-0.9.zip)): This is a major update so YMMV. Please report any issues.
+ Converted to UFO format and updated base fonts to benefit from work done on [Source Code Pro](https://github.com/adobe-fonts/source-code-pro/):
- ***Italics!***
- Greek & Cyrillic script support
- Better powerline symbols
- [Much, much more](https://github.com/adobe-fonts/source-code-pro/releases/tag/2.010R-ro%2F1.030R-it)
- Added tags that enable support for some IntelliJ IDEA Builds
2016-07-15 16:51:20 +03:00
+ v0.4: New ligatures: `<*` `<*>` `<+>` `<$>` `***` `<|>` `!!` `||` `===` `==>`, [Powerline](https://github.com/powerline/powerline) symbol support
2015-12-28 23:17:59 +03:00
+ v0.3: New ligatures: `<<<` `>>>` `<>` and `+++`
+ v0.2: Lengthened `==` and `/=` to match other equals signs
+ v0.1: Ligatures `<-` `->` `=>` `>>` `<<` `>>=` `=<<` `..` `...` `::` `-<` `>-` `-<<` `>>-` `++` `/=` and `==`
#### Currently implemented symbols
2016-03-16 14:31:57 +03:00
`<*` `<*>` `<+>` `<$>` `***` `<|` `|>` `<|>` `!!` `||` `===` `==>` `<<<` `>>>` `<>` `+++` `<-` `->` `=>` `>>` `<<` `>>=` `=<<` `..` `...` `::` `-<` `>-` `-<<` `>>-` `++` `/=` `==`
2015-12-28 23:17:59 +03:00
#### Editor Support
This list is compiled based on reports on the current state of support for code editors and terminals. This list
2015-12-28 23:17:59 +03:00
2015-12-31 18:57:13 +03:00
#### Supported editors
+ Atom (*[since v1.1.0](http://blog.atom.io/2015/10/29/atom-1-1-is-out.html)*)
2017-01-21 20:21:58 +03:00
- Can also be installed as package courtesy of [atom-hasklig](https://atom.io/packages/hasklig) by [adilparvez](https://github.com/adilparvez)
2015-12-28 23:17:59 +03:00
+ BBEdit 11 ([Instructions](https://github.com/i-tu/Hasklig/issues/3#issue-46601683))
+ Brackets
2015-12-28 23:17:59 +03:00
+ Chocolat
+ Geany
+ gEdit
2017-04-24 11:12:49 +03:00
+ iTerm2 (*[Currently only using beta build 3.1 and onwards](https://gitlab.com/gnachman/iterm2/issues/3568#note_13118332)*)
2015-12-28 23:17:59 +03:00
+ Kate
+ Konsole
+ KWrite
+ Leksah (_x64 W8 reported not working_)
+ Light Table ([Instructions](https://github.com/LightTable/LightTable/issues/1459#issuecomment-57366504))
+ MacVim (_Since release 79. See [Issue 32](https://github.com/i-tu/Hasklig/issues/32)_)
2015-12-28 23:17:59 +03:00
+ QtCreator (_v.3.2.2 on GNU/Linux x64_)
2016-01-01 14:42:54 +03:00
+ RStudio
2015-12-28 23:17:59 +03:00
+ Smultron
+ Sublime Text 3
2017-04-24 11:09:19 +03:00
+ Terminal (OSX)
2015-12-28 23:17:59 +03:00
+ TextEdit
+ TextMate (_from version 2.0-alpha.9549 onwards_)
+ Vico
2016-01-01 14:42:54 +03:00
+ Visual Studio 2015
2017-04-24 11:09:19 +03:00
+ Visual Studio Code
+ Xcode (requires [an additional plugin](https://github.com/robertvojta/LigatureXcodePlugin))
+ IntelliJ IDEA (*[since v2016.2](https://blog.jetbrains.com/idea/2016/07/intellij-idea-2016-2-is-here)*)
2015-12-28 23:17:59 +03:00
#### No support
2016-01-01 14:42:54 +03:00
- Emacs
2015-12-28 23:17:59 +03:00
- gVim (_output corrupted. A_ [patch](https://groups.google.com/forum/#!topic/vim_dev/0sETSAwe5Wo) _exists, but it has not been incorporated into mainstream gVim._)
2017-04-24 11:09:19 +03:00
- KDevelop 4
- Notepad++
2015-12-28 23:17:59 +03:00
- Xamarin Studio/Monodevelop
2015-12-31 18:57:13 +03:00
### Building the fonts from source
#### Requirements
To build the binary font files from source, you need to have installed the
[Adobe Font Development Kit for OpenType](http://www.adobe.com/devnet/opentype/afdko.html) (AFDKO). The AFDKO
tools are widely used for font development today, and are part of most font
editor applications.
2016-01-25 12:15:34 +03:00
Some SVG glyphs are inserted into the fonts using Python [FontTools](https://pypi.python.org/pypi/FontTools).
2015-12-31 19:09:38 +03:00
#### Building font instances from masters
2015-12-31 19:11:40 +03:00
This repository only includes so-called *master* weights of the fonts (effectively extralight and black).
The shapes of the weights in between these extremities are calculated by `makeInstancesUFO` supplied with `.designspace` files.
2015-12-31 19:13:52 +03:00
For convenience, the shell script **buildInstances** is provided, which executes `makeInstancesUFO`, calculating all the italic and regular font weight shapes.
```sh
$ ./buildInstances.sh
```
2015-12-31 19:09:38 +03:00
2015-12-31 18:57:13 +03:00
#### Building one font
The key to building OTF or TTF fonts is `makeotf`, which is part of the AFDKO toolset.
Information and usage instructions can be found by executing `makeotf -h`.
In this repository, all necessary files are in place for building the OTF and TTF fonts.
For example, build a binary OTF font for the Regular style like this:
```sh
$ cd Roman/Regular/
$ makeotf -r
```
#### Building all fonts
For convenience, a shell script named **build** is provided in the root directory.
It builds all OTFs and TTFs, and can be executed by typing:
```sh
$ ./build.sh
```
or this on Windows:
```sh
> build.cmd
```
### Credits
2015-12-28 23:17:59 +03:00
Original idea, design and implementation of code ligatures by Ian Tuomi 2014-2015.
2015-12-31 19:09:38 +03:00
This typeface extends [Source Code Pro](https://github.com/adobe-fonts/source-code-pro) with ligatures.