November 16, 2016·4 min read·engineeringgofontstypography

Go fonts make technical text easier to distribute

The Go font family began with a testing problem in Shiny. Its character shapes and distribution terms make it useful beyond that toolkit.

The experimental Shiny user interface toolkit needed fonts for testing its text elements. Choosing a font also meant choosing what developers could obtain and redistribute. The Go project answered that problem by commissioning Bigelow & Holmes to design a family of TrueType fonts. The announcement on November 16 describes both proportional and monospaced designs, with the same open source license as Go itself. That licensing decision matters to software that needs to carry its typography with it.

I like Go because its ordinary decisions keep programs readable. A font belongs in that discussion when it helps a reader distinguish characters that have different meanings in source code. The useful question is whether the design makes technical text easier to read and distribute. A visual identity alone would not answer the original Shiny testing problem.

Character shapes carry information

Go's proportional family is a humanist sans-serif design. Go Mono uses slab serifs and gives characters equal widths. The shared humanist basis does not make the families interchangeable. Fixed character widths support alignment in source listings, while proportional spacing suits continuous prose. Documentation containing both needs a relationship between the two without requiring the same spacing rules everywhere.

The announcement identifies several pairs that the designers deliberately distinguish. Zero and capital O need different shapes, as do numeral one, capital I, and lowercase l. Similar treatment separates five from capital S and eight from capital B. These distinctions concern the identity of a character before they concern the appearance of a paragraph. In a code sample or an identifier, substituting one of those characters changes the text that the reader must understand.

The designers also keep asymmetry in the bowls of b, d, p, and q. That is a specific design decision with a technical application. A family can look internally consistent without making every related letter a rotation of the same shape. Consistency has to leave enough difference for recognition. The announcement connects these decisions to the differentiation requirements in DIN 1450.

This is the part of the release that interests me most. Readable software depends on small distinctions staying visible. Typography can preserve those distinctions without adding another convention that the programmer must learn. The benefit belongs to anyone reading the text, including someone who has never heard of the font family.

Size and spacing are separate choices

The fonts have an x-height of 53 percent of the body size. The announcement compares that with Courier's 45 percent and explains that Go Mono consequently looks larger at the same nominal size. Go Mono retains Courier's character width. Increasing the apparent size of lowercase letters therefore does not require reducing the number of characters that fit on a line.

That separates two concerns that are easy to confuse when choosing an editor font. Nominal point size does not determine how large the lowercase letters appear. Character width determines the horizontal space consumed by a monospaced listing. A different design can change the former while retaining the latter. The announcement's comparison is about those metrics, not a measured improvement in programming speed.

The proportional fonts are nearly metrically compatible with Arial and Helvetica. The qualification matters. Some letters are wider because of the legibility choices, so a passage can occupy slightly more space. Replacing a font in an existing interface cannot assume identical wrapping merely because the metrics are close. The design offers a familiar amount of space for prose while allowing differences in individual glyphs.

Go Mono has normal and bold weights. Their character widths match, so using bold does not require a different column width. The proportional family also has a medium weight. Its normal, medium, and bold numerical weights are 400, 500, and 600. The announcement explains that these numbers follow the progression of stem thickness. Software integrating the fonts should use the supplied weight relationships when associating files with styles.

Distribution is part of the implementation

The release provides individual Go packages for the fonts, including golang.org/x/image/font/gofont/goregular. The announcement shows parsing its TTF data with truetype.Parse from github.com/golang/freetype/truetype. It also gives a route to the standalone files under font/gofont/ttfs in the image repository. A program consuming font data and a person installing a font therefore have separate entry points.

Those packages make the font bytes available to a Go program. Parsing the bytes is still distinct from laying out and drawing text. The announcement explicitly identifies the available TrueType parser and describes another parser as work in progress. That distinction keeps the release's scope clear. The project has supplied fonts and a documented way to consume them without claiming that a complete interface toolkit is finished.

The Go team's seventh anniversary post, published six days earlier, discusses compiler work and the integration of context into the standard library. Fonts address another part of using the language, the presentation of programs and documentation. That is a reasonable expansion of the project's supporting tools. The original need came from software under development, and the resulting files can also support technical text outside that software.

Both families provide WGL4 coverage, including Latin text for Western and Eastern European languages, Modern Greek, and Cyrillic. The announcement describes more than 650 characters, together with symbols and graphical characters. This is a stated coverage boundary, not a claim to cover every writing system. A program choosing these fonts still needs its required text to fall within that supported set. The release gives developers an identifiable family with documented metrics, character coverage, and distribution terms to make that choice against.