1
1
mirror of https://github.com/i-tu/Hasklig.git synced 2024-09-17 13:37:21 +03:00
Hasklig - a code font with monospaced ligatures
Go to file
2016-01-25 14:35:12 +02:00
emoji Rebuild Hasklig based on latest Source Code Pro 2015-12-28 21:36:08 +02:00
Italic Rebuild Hasklig based on latest Source Code Pro 2015-12-28 21:36:08 +02:00
ItalicMasters Fix some widths 2016-01-25 14:35:12 +02:00
Roman Rebuild Hasklig based on latest Source Code Pro 2015-12-28 21:36:08 +02:00
RomanMasters Fix a few broken glyphs 2016-01-25 11:56:26 +02:00
svg Rebuild Hasklig based on latest Source Code Pro 2015-12-28 21:36:08 +02:00
.gitignore ignore font.ufo 2015-12-28 21:38:20 +02:00
addSVGtable.py Use font.getGlyphID() instead 2015-12-28 22:20:01 +02:00
all.rtf Add italics to testing rtf 2015-12-31 17:16:08 +02:00
build.cmd Rebuild Hasklig based on latest Source Code Pro 2015-12-28 21:36:08 +02:00
build.sh Rebuild Hasklig based on latest Source Code Pro 2015-12-28 21:36:08 +02:00
buildInstances.sh Rebuild Hasklig based on latest Source Code Pro 2015-12-28 21:36:08 +02:00
family.fea Add IntelliJ fix 2015-12-31 17:57:24 +02:00
FontMenuNameDB Rebuild Hasklig based on latest Source Code Pro 2015-12-28 21:36:08 +02:00
gen_calt.clj Add contextual alternate generation from Fira Code 2016-01-24 23:53:30 +02:00
GlyphOrderAndAliasDB Rebuild Hasklig based on latest Source Code Pro 2015-12-28 21:36:08 +02:00
hasklig_example.png pic 2014-04-20 05:03:34 +03:00
ligatures.fea Add contextual alternate generation from Fira Code 2016-01-24 23:53:30 +02:00
README.md Add mention of Python FontTools 2016-01-25 11:15:34 +02:00
SourceCodeProSample.png Bring back SCP sample 2015-12-31 17:18:08 +02:00
tables.fea Rebuild Hasklig based on latest Source Code Pro 2015-12-28 21:36:08 +02:00
widthsAdjust.fea Rebuild Hasklig based on latest Source Code Pro 2015-12-28 21:36:08 +02:00
widthsAdjust.mark first release 2012-09-20 17:06:26 -07:00

N.B. This is a fork of the Source Code Pro repository

Hasklig Ligatures for code

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.

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 to achieve an appealing rendering, but it is of no use when programming.

Some Haskellers have resorted to Unicode symbols (, etc.), which are valid in the ghc. 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.

Hasklig solves the problem the way typographers have always solved ill-fitting characters which co-occur often: ligatures. The underlying code stays the same — only the representation changes.

Not only can multi-character glyphs be rendered more vividly, other problematic things in monospaced fonts, such as spacing can be corrected.

Download Hasklig Font Family v0.9

Hasklig

Hasklig Sample

Source Code Pro

Source Code Pro Sample

Release notes

  • v0.9: 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:
      • Italics!
      • Greek & Cyrillic script support
      • Better powerline symbols
      • Much, much more
    • Added tags that enable support for some IntelliJ IDEA Builds
  • v0.4: New ligatures: <* <*> <+> <$> *** <|> !! || === ==>, Powerline symbol support
  • v0.3: New ligatures: <<< >>> <> and +++
  • v0.2: Lengthened == and /= to match other equals signs
  • v0.1: Ligatures <- -> => >> << >>= =<< .. ... :: -< >- -<< >>- ++ /= and ==

Currently implemented symbols

<* <*> <+> <$> *** <|> !! || === ==> <<< >>> <> +++ <- -> => >> << >>= =<< .. ... :: -< >- -<< >>- ++ /= ==

Editor Support

This list is compiled based on reports on the current state of support for code editors and terminals. This list

Supported editors

  • Atom (since v1.1.0)
  • BBEdit 11 (Instructions)
  • Chocolat
  • Geany
  • gEdit
  • Kate
  • Konsole
  • KWrite
  • Leksah (x64 W8 reported not working)
  • Light Table (Instructions)
  • MacVim (Since release 79. See Issue 32)
  • QtCreator (v.3.2.2 on GNU/Linux x64)
  • RStudio
  • Smultron
  • TextEdit
  • TextMate (from version 2.0-alpha.9549 onwards)
  • Vico
  • Visual Studio 2015
  • Xcode (requires an additional plugin)

No support

  • Emacs
  • gVim (output corrupted. A patch exists, but it has not been incorporated into mainstream gVim.)
  • Intellij IDEA (Has feature request and a working hack with a preview build. Note that the 0.9 typeface family has been patched with the fix mentioned.)
  • iTerm2 (details)
  • Sublime Text (Vote for the enhancement here)
  • Terminal (OSX)
  • Xamarin Studio/Monodevelop

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 (AFDKO). The AFDKO tools are widely used for font development today, and are part of most font editor applications.

Some SVG glyphs are inserted into the fonts using Python FontTools.

Building font instances from masters

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. For convenience, the shell script buildInstances is provided, which executes makeInstancesUFO, calculating all the italic and regular font weight shapes.

$ ./buildInstances.sh

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:

$ 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:

$ ./build.sh

or this on Windows:

> build.cmd

Credits

Original idea, design and implementation of code ligatures by Ian Tuomi 2014-2015. This typeface extends Source Code Pro with ligatures.