golang.org/toolchain@v0.0.1-go1.9rc2.windows-amd64/blog/content/go-fonts.article (about) 1 Go fonts 2 16 Nov 2016 3 4 Nigel Tao 5 6 Chuck Bigelow 7 8 Rob Pike 9 10 * An Announcement 11 12 The experimental user interface toolkit being built at 13 [[https://godoc.org/golang.org/x/exp/shiny][`golang.org/x/exp/shiny`]] 14 includes several text elements, but there is a problem with testing them: 15 What font should be used? 16 Answering this question led us to today's announcement, 17 the release of a family of high-quality [[https://en.wikipedia.org/wiki/Windows_Glyph_List_4][WGL4]] TrueType fonts, 18 created by the [[http://bigelowandholmes.typepad.com/][Bigelow & Holmes]] type foundry specifically for the Go project. 19 20 The font family, called Go (naturally), includes proportional- and fixed-width faces in normal, bold, and italic renderings. 21 The fonts have been tested for technical uses, particularly programming. 22 Go source code looks particularly good when displayed in Go fonts, as its name implies, with things like 23 punctuation characters easily distinguishable and operators lined up and placed consistently: 24 25 .image go-fonts/go-font-code.png _ 519 26 27 Perhaps the most remarkable feature of the Go fonts is their license: 28 They are licensed under the same open source license as the rest of the Go project's software, 29 an unusually free arrangement for a high-quality font set. 30 31 Here are samples of the proportionally-spaced... 32 33 .image go-fonts/go-regular.png _ 600 34 35 and monospaced fonts: 36 37 .image go-fonts/go-mono.png _ 600 38 39 * How to use them 40 41 If you just want the TTF files, run 42 43 git clone https://go.googlesource.com/image 44 45 and copy them from the subsequent `image/font/gofont/ttfs` directory. 46 If you want to use Go (the fonts) with Go (the software), each font is provided by a separate package. 47 To use the Go Regular font in a program, import `golang.org/x/image/font/gofont/goregular`, and write: 48 49 50 font, err := truetype.Parse(goregular.TTF) 51 52 53 The [[https://godoc.org/github.com/golang/freetype/truetype][`github.com/golang/freetype/truetype`]] 54 package provides the [[https://godoc.org/github.com/golang/freetype/truetype#Parse][`truetype.Parse`]] function today. 55 There is also work underway to add a TrueType package under `golang.org/x` 56 again licensed under the same open source license as the rest of the Go project's software. 57 58 59 We leave it to you to find some of the other unusual properties the fonts have, 60 but for an overview of the fonts' design we asked Chuck Bigelow to provide some background. 61 The remainder of this blog post is his response. 62 63 * Notes on the fonts, by Chuck Bigelow 64 65 The Go fonts are divided into two sets, Go proportional, which is 66 sans-serif, and Go Mono, which is slab-serif. 67 68 69 * Go proportional fonts 70 71 72 ** Sans-serif 73 74 Go proportional fonts are sans-serif, like several popular fonts 75 for screen displays. There is some evidence that some sans-serif 76 faces at small sizes and low resolutions on screens are slightly 77 more legible than their seriffed counterparts, while at large sizes, 78 there is not a significant difference in legibility between sans and 79 seriffed faces, at least in the pair tested. [1] (The bracketed numbers 80 refer to the references listed at the end of this article.) 81 82 83 ** Style 84 85 Go sans-serif fonts are "humanist" rather than "grotesque" in 86 style. This is an historical distinction, not an aesthetic judgment. 87 Widely used sans-serif fonts like Helvetica and Arial are called 88 grotesque because an early 19th century sans-serif typeface 89 was named "Grotesque," and the name became generic. 90 91 92 The shapes of modern grotesque fonts like Helvetica are sculpted, 93 with smooth, assimilated forms. 94 95 96 Humanist sans-serifs are derived from Humanist handwriting 97 and early fonts of the Italian Renaissance and still show subtle 98 traces of pen-written calligraphy. There is some evidence that 99 humanist fonts are more legible than grotesque fonts. [2] 100 101 102 ** Italics 103 104 Go proportional italics have the same width metrics as the roman 105 fonts. Go italics are oblique versions of the romans, with one 106 noticeable exception: the italic lowercase 'a' is redesigned as a 107 cursive single-story form to harmonize with the bowl shapes of 108 the b d g p q set, in which the upright forms also adapt well to 109 slanting, The addition of cursive 'a' makes the italics appear more 110 lively than a simply slanted roman. Some typographers believe that 111 slanted roman sans-serif italics are preferable to truly "cursive" sans 112 Italics, in part because of history and design. [3] 113 114 .image go-fonts/abdgpq-proportional.png 115 116 ** The x-height 117 118 The x-height of a typeface is the height of the lowercase 'x' relative 119 to the body size. The x-height of Go fonts is 53.0% of body size, a 120 bit larger than the x-heights of Helvetica (52.3%) or Arial (51.9%), 121 but the difference is usually unnoticeable at normal reading sizes. 122 Typographers believe that larger x-heights contribute to greater 123 legibility in small sizes and on screens. A study of "print size" 124 (particularly x-height) and reading noted that types for reading on 125 screens and for small sizes tend to have large x-heights. [4] 126 127 128 ** DIN Legibility Standard 129 130 The recent German DIN 1450 legibility standard recommends 131 several features for font legibility, including differentiation of 132 letter shapes to reduce confusion. The Go fonts conform to the 133 1450 standard by carefully differentiating zero from capital O; 134 numeral 1 from capital I (eye) and lowercase l (ell); numeral 5 from 135 capital S; and numeral 8 from capital B. The shapes of bowls of 136 b d p q follow the natural asymmetries of legible Renaissance 137 handwriting, aiding differentiation to reduce confusion. [5] 138 139 140 ** Weights 141 142 The Go proportional fonts come in three weights: Normal, Medium, 143 and Bold. The Normal weight is strong enough that it maintains 144 clarity on backlit screens, which often tend to erode letter features 145 and thickness. The Medium weight has stem thickness 1.25 times 146 the Normal, for greater sturdiness on bright screens or for users 147 who prefer a sturdy font. The Bold weight has stem thickness 148 1.5 times the Normal, bold enough to be distinct from the normal 149 weight. These Go fonts have CSS numerical weights of 400, 500, 150 and 600. Although CSS specifies "Bold" as a 700 weight and 600 151 as Semibold or Demibold, the Go numerical weights match the 152 actual progression of the ratios of stem thicknesses: 153 Normal:Medium = 400:500; Normal:Bold = 400:600. The Bold 154 weight name matches the use of “Bold” as the usual corresponding 155 bold weight of a normal font. More discussion of the relationship of 156 stem thicknesses, weight names, and CSS numbering is in [6]. 157 158 159 ** WGL4 character set 160 161 The WGL4 character set, originally developed by Microsoft, is often 162 used as an informal standard character set. WGL4 includes Western 163 and Eastern European Latin characters plus Modern Greek and 164 Cyrillic, with additional symbols, signs, and graphical characters, 165 totalling more than 650 characters in all. The Go WGL4 fonts can 166 be used to compose a wide range of languages. [7] 167 168 169 ** Metric compatibility with Arial and Helvetica 170 171 The Go sans-serif fonts are nearly metrically compatible with 172 standard Helvetica or Arial characters. Texts set in Go occupy 173 nearly the same space as texts in Helvetica or Arial (at the same 174 size), but Go has a different look and texture because of its 175 humanist style. Some Go letters with DIN legibility features are 176 wider than corresponding letters in Helvetica or Arial, so some 177 texts set in Go may take slightly more space. 178 179 180 * Go Mono fonts 181 182 183 ** Monospaced 184 185 Go Mono fonts are monospaced—each letter has the same width as 186 the other letters. Monospaced fonts have been used in programming 187 since the beginning of computing and are still widely used because the 188 typewriter regularity of their spacing makes text align in columns and 189 rows, a style also found in Greek inscriptions of the 5th century BC. 190 (The ancient Greeks didn't have typewriters or computer keyboards, 191 but they did have great mathematicians and a great sense of symmetry 192 and pattern that shaped their alphabet.) 193 194 195 ** Slab-serif 196 197 The Go Mono fonts have slab-shaped serifs, giving them a sturdy 198 appearance. 199 200 201 ** Style 202 203 The underlying letter shapes of Go Mono are, like the Go sans-serif fonts, 204 derived from humanist handwriting, but the monospacing and slab serifs 205 tend to obscure the historical and stylistic connections. 206 207 208 ** Italics 209 210 Go Mono Italics are oblique versions of the romans, with the exception 211 that the italic lowercase 'a' is redesigned as a cursive single-story form 212 to harmonize with the bowl shapes of the b d g p q. The cursive 'a' makes 213 the italics appear more lively than a simply slanted roman. As with many 214 sans-serif fonts, it is believed that slanted roman slab-serifs fonts may 215 be more legible than truly "cursive" italics. 216 217 .image go-fonts/abdgpq-mono.png 218 219 ** The x-height 220 221 Go Mono fonts have the same x-height as Go sans-serif fonts, 53% of 222 the body size. Go Mono looks almost 18% bigger than Courier, which 223 has an x-height 45% of body size. Yet Go Mono has the same width 224 as Courier, so the bigger look is gained with no loss of economy in 225 characters per line. 226 227 228 ** DIN Legibility Standard 229 230 Go Mono fonts conform to the DIN 1450 standard by differentiating 231 zero from capital O; numeral 1 from capital I (eye) and lowercase l (ell); 232 numeral 5 from capital S; and numeral 8 from capital B. The shapes of 233 bowls of b d p q follow the natural asymmetries of legible Renaissance 234 handwriting, aiding differentiation and reducing confusion. 235 236 237 ** Weights 238 239 Go Mono fonts have two weights: Normal and Bold. The normal weight 240 stem is the same as in Go Normal and thus maintains clarity on backlit 241 screens, which tend to erode letter features and stem thickness. The 242 bold stem thickness is 1.5 times thicker than the normal weight, hence 243 the Bold Mono has the same stem thickness as Bold Go proportional. 244 Because the letter width of monospaced bold is identical to the width of 245 monospaced normal, the bold Mono appears slightly bolder than the 246 proportional Go Bold, as more black pixels are put into the same area.) 247 248 249 ** Metric compatibility with popular monospaced fonts 250 251 Go Mono is metrically compatible with Courier and other monospaced 252 fonts that match the "Pica" typewriter type widths of 10 characters per 253 linear inch at 12 point. At 10 point, Go Mono fonts set 12 characters 254 per inch. The TrueType fonts are scalable, of course, so Go Mono can 255 be set at any size. 256 257 258 ** WGL4 character set 259 260 The Go Mono fonts offer the WGL4 character set often used as an 261 informal standard character set. WGL4 includes Western and Eastern 262 European Latin characters plus Modern Greek and Cyrillic, with 263 additional symbols, signs, and graphical characters. The 650+ characters 264 of the Go WGL4 sets can be used for a wide range of languages. 265 266 267 268 269 * References 270 271 272 [1] Morris, R. A., Aquilante, K., Yager, D., & Bigelow, C. (2002, May). P‐13: Serifs Slow RSVP Reading at Very Small Sizes, but Don't Matter at Larger Sizes. In SID Symposium Digest of Technical Papers (Vol. 33, No. 1, pp. 244-247). Blackwell Publishing Ltd. 273 274 275 [2] Bryan Reimer et al. (2014) “Assessing the impact of typeface design in a text-rich automotive user interface”, Ergonomics, 57:11, 1643-1658. 276 http://www.tandfonline.com/doi/abs/10.1080/00140139.2014.940000 277 278 279 [3] Adrian Frutiger - Typefaces: The Complete Works. H. Osterer and P. Stamm, editors. Birkhäuser, Basel, 2009, page 257. 280 281 282 [4] Legge, G. E., & Bigelow, C. A. (2011). Does print size matter for reading? A review of findings from vision science and typography. Journal of Vision, 11(5), 8-8. http://jov.arvojournals.org/article.aspx?articleid=2191906 283 284 285 [5] Charles Bigelow. "Oh, oh, zero!" TUGboat, Volume 34 (2013), No. 2. 286 https://tug.org/TUGboat/tb34-2/tb107bigelow-zero.pdf 287 https://tug.org/TUGboat/tb34-2/tb107bigelow-wang.pdf 288 289 290 [6] "Lucida Basic Font Weights" Bigelow & Holmes. 291 http://lucidafonts.com/pages/facts 292 293 294 [7] WGL4 language coverage: Afrikaans, Albanian, Asu, Basque, 295 Belarusian, Bemba, Bena, Bosnian, Bulgarian, Catalan, Chiga, 296 Colognian, Cornish, Croatian, Czech, Danish, Embu, English, Esperanto, 297 Estonian, Faroese, Filipino, Finnish, French, Friulian, Galician, 298 Ganda, German, Greek, Gusii, Hungarian, Icelandic, Inari Sami, 299 Indonesian, Irish, Italian, Jola-Fonyi, Kabuverdianu, Kalaallisut, 300 Kalenjin, Kamba, Kikuyu, Kinyarwanda, Latvian, Lithuanian, Lower 301 Sorbian, Luo, Luxembourgish, Luyia, Macedonian, Machame, Makhuwa-Meetto, 302 Makonde, Malagasy, Malay, Maltese, Manx, Meru, Morisyen, North 303 Ndebele, Northern Sami, Norwegian Bokmål, Norwegian Nynorsk, Nyankole, 304 Oromo, Polish, Portuguese, Romanian, Romansh, Rombo, Rundi, Russian, 305 Rwa, Samburu, Sango, Sangu, Scottish Gaelic, Sena, Serbian, Shambala, 306 Shona, Slovak, Slovenian, Soga, Somali, Spanish, Swahili, Swedish, 307 Swiss German, Taita, Teso, Turkish, Turkmen, Upper Sorbian, Vunjo, 308 Walser, Welsh, Zulu 309 310 * Jabberwocky in Go Regular 311 312 From [[https://en.wikipedia.org/wiki/Jabberwocky]]: 313 314 .image go-fonts/go-font-jabberwocky.png _ 500 315 316 There is no Greek version listed. Instead, a pangram from [[http://clagnut.com/blog/2380/#Greek]]: 317 318 .image go-fonts/go-font-greek.png _ 530