Fonts

Typeface nerdery and its intersection with my life. I do not know much about typefaces, but do see On Snot and Fonts for some entertaining history.

Installing fonts

Installing fonts on Ubuntu is manual, although some are available as .deb packages.

On macOS you can just double click on a font. Certain useful fonts are packaged using homebrew:

brew cask install cask-fonts
brew cask install font-hack-nerd-font

Coding fonts

Fonts that ideally look good in monospace and make it easy to distinguish similar characters. (My bugbear here is distinguishing different quotes, e.g. "“”). There is a website for this ProgrammingFonts.org, where you can see all the alternatives of note. Google also maintain a web-font-oriented database. Your OS ships with some, maybe Ubuntu Mono or Inconsolata or such. Or you can level up your nerd OCD by using Nerdfonts.com, which distributes cult developer-friendly fonts with extra glyphs for … weird UI icons and such?

  • Source Code Pro in the light variant is my favourite font for coding.
  • Office Code Pro is based on Source Code Pro but tweaked “specifically for text editors and coding environments”. Looks nicer but AFAICT missing Greek.
  • Hack is a popular open source option
  • Roboto Mono is everywhere thanks to Google backing
  • Fira Code has fancy coding ligatures, which is a whole coding hipster thing.

International fonts

SIL provide many useful fonts for less mainstream languages, including Doulos which to my geeky pleasure supports the International Phonetic Alphabet.

wget http://packages.sil.org/sil-repository.deb && sudo dpkg -i sil-repository.deb
apt install font-sil-doulos

m-plus fonts seemed like minimalist sans-serif fonts designed to support Japanese then threw a bunch of other useful stuff in there too, targeting coders and even LaTeX users. included in ubuntu.

In addition to European letters used in many Western European languages, Japanese characters that including Kana glyphs and more than 5,300 Kanji glyphs, and major international phonetic symbols, operators, special symbols, etc. are also prepared.

All Latin glyph sets were completed with Basic Latin, Latin-1 Supplement, Latin Extended-A, and IPA Extensions. And most of Greek, Cyrillic, Vietnamese, and extended glyphs and symbols were prepared too.

I also need Sundanese: Sundanese-unicode-2-0-ttf,

Google’s Noto font famously aspires to support all languages and claims Sundanese, as does Prada, but I have not tested them myself.

LaTeX

Esp for mathematics.

I am not the person to ask about the intimate details of LaTeX font hell but see TUG font catalogue for traditional LaTeX math font support and mathspec for XelaTeX font support. To understand the intricacties of how maths typesettings works work check out the Free math Survey. This is outdated now but is a good conservative starting point AFAICT.

Classic LaTeX math

Or nearly-classic, using Type 1 postscript fonts and whatever dark magic LaTeX uses to make those go.

tlmgr install \
    ebgaramond \
    ebgaramond-maths \
    newtx \
    gfsneohellenicmath \
    mathdesign \
    stix2-otf \
    baskervillef \
    fira \
    firamath-otf \
    eulervm \
    mathpazo \
    sfmath \
    psnfss \
    rsfs

tl;dr There is some complicated set of interactions between main font and math font and possibly a special greek font and typesetting engine, and which format my fonts happen to be in (which BTW changes how one must install them, which is in turn dependent upon the OS I am using) and which features I want and what my text encoding is, and if I get any one of those wrong there are weird and unhelpful errors and the whole thing is very far from my top priority so I am trying not to learn anything more about it and will do my best to be unable to advise any further. Fortunately if I cargo-cult some example configurations things seem to work out OK.

These seem to work:

% Garamond
\usepackage[garamond]{mathdesign}
% Garamond
\usepackage[garamond]{mathdesign}
%garamond
\usepackage{fourier}
% Utopia
\usepackage[utopia]{mathdesign}
% Times
\usepackage{mathptmx}
% Times
\usepackage{mbtimes}
% Palatino
\usepackage{mathpazo}

unicode-math

The experimentally modern world of unicode-math (i.e. typesetting using modern unicode encodings and OpenType fonts) has a unicode math font list.

One sets it up via

tlmgr install \
    unicode-math \
    fontspec \
    lualatex-math \
    l3kernel \
    l3packages \
    l3experimental

unicode-math

The experimentally modern world of unicode-math has a unicode math font list.

Unicode maths is currently supported by the following freely available open source fonts:

  • Latin Modern Math (Bogusław Jackowski, Janusz M. Nowacki)(minimal one, attempts to look like the 80s font Computer modern) — tlmgr install lm-math
  • Tex Gyre family (looks kinda like the fonts that every word processor uses) — tlmgr install tex-gyre tex-gyre-math
  • Asana Math (Apostolos Syropolous) — tlmgr install Asana-Math
  • STIX2 (STIpub) — tlmgr install stix2-otf and
  • XITS Math (Khaled Hosny) — tlmgr install xits
  • Libertinus Math (Philipp H. Poll and Khaled Hosny) — tlmgr install libertinus
  • Fira Math (Xiangdong Zeng) — tlmgr install firamath.

The following fonts are proprietary with OpenType maths support:

Font mangling

You can alter fonts! Programatically!

Schmelvetica is an example of how you can modify a font algorithmically, based on the parodical Smelvetica, and presuably Hellvetica. Or, for a flakey but cute hack using machine learning, SVGVAE will algorithmically design fonts! For the moment, quirky nasty fonts.

Retro OCR fonts

Magnetic Ink fonts and their progeny give you that future-from-the-70s feel. The classics are AFAICT Westminster or OCA-A (which is free)

Miscellaneous fonts

powerline fonts.

sudo apt-get install fonts-powerline