Skip to content


Subversion checkout URL

You can clone with
Download ZIP
deviation kerning - an experimental technique for monospace fonts
C Other
Branch: vt52
Failed to load latest commit information.
18 18: various edkerning
as as: edkern tweak 'ig'
scribit Added remaining glyphs to font 'scribit'
.gitignore 'progress' displays kern-scoring ("edkerning") progress
18.termkf Unspecified changes to fonts as, 18
Makefile Added font 'scribit', and support for it
README kern.c: proper O(n) kerning, with a trellis (instead of the previous …
as.termkf Unspecified changes to fonts as, 18
bits.c fix use-after-free (valgrind reported)
bits.h fix use-after-free (valgrind reported)
edkern.c kern.o: if scores are missing, prefer spa=0
ffing ligatures: tj (a rather odd-looking glyph)
fontify.c Reading from kfa archives
kern.c kern.o: if scores are missing, prefer spa=0
kern.h kern.o: if scores are missing, prefer spa=0
kern_hack.h kern.o: save some memory
kfa.c Reading from kfa archives
kfa.h Reading from kfa archives
king2 Remove a 'smart quote' from kern king part 2
king_80x24 kernify: display text monokerned. Also fixed some kern.o bugs
new_algo Idea for a new algorithm with better running time
pbm.c Added font 'scribit', and support for it
pbm.h Reading from kfa archives
plans plans - some characterisation of that exec bug
progress.c kern.o: if scores are missing, prefer spa=0
scribit.termkf Added remaining glyphs to font 'scribit'
termk.c Added font 'scribit', and support for it
termk52-w.ti \E save_cursor and restore_cursor
termk52.ti \E save_cursor and restore_cursor


monokern: a project to create a kerned monospace font for terminals and code.

"Wait, did you say /kerned monospace/?"  Yes, I did - and that's not as ridiculous as it sounds.  The alignment of columnar and tabular text that monospace provides relies not on the spacing itself being constant, but of the sum of the spacing over longer runs being constant.  Thus, so long as a narrow pair-kerning is balanced out by a wide pair-kerning nearby, tables will remain aligned.
The basic idea behind monokern is /deviation kerning/: any individual character is permitted to deviate a fixed amount from its grid position.  In the initial experiments, this is 1px, because we're working with a small font just 6px wide.
kern.o performs the basic monokerning operation, using a dynamic-programming algorithm with linear-time performance.

To run a terminal that monokerns text: termk [shell] [shellargs]

termk's emulated terminal is based on a vt52, which is somewhat limited in its capabilities.
However, termk has several capabilities the vt52 does not, such as attributes (colours, boldface, reverse video) and function keys.  These are enabled if the appropriate terminfo entry is present; termk has its own terminfo record, which is installed to /usr/share/terminfo by [sudo] make install.  If the terminfo record is missing, termk will fall back to a standard vt52.
Also, termk does not currently have Unicode support.
Lastly note that termk gets the font (and kerning tables) from an archive 'as.termkf' which it expects to find in /usr/local/share/fonts; consequently, you need to [sudo] make install, first, or it won't run.
There is a second font, somewhat larger; to use it, run "termk -18 [shell] [shellargs]".  The -18 font has not been fully kerned or ligated yet.
Something went wrong with that request. Please try again.