Add fonts post.
[blog.git] / posts / Fonts.mdwn
1 Here are some quick notes on working with fonts on Linux.
2
3 X Windows fonts
4 ===============
5
6 Fonts are managed by [fontconfig][].  For per-user fonts, you can
7 generally just drop your font into `~/.fonts/`, and it will be picked
8 up by X.  You can use `fc-list` to list fonts that X can find.
9
10     $ fc-list
11     Verdana:style=Regular,Normal,obyčejné,Standard,Κανονικά,…
12     ClassicHeavy:style=Light
13     Nimbus Sans L:style=Regular Italic
14     Shalom:style=Stick
15     …
16
17 I use [gucharmap][] to browse fonts and select unicode characters that
18 I haven't yet bound to the keyboard via [[Xmodmap]] or
19 [[XCompose|Compose_key]].  There are a number of nice fonts over at
20 the [Open Font Library][OFL].
21
22 Web fonts
23 =========
24
25 Modern desktop fonts are generally [TrueType][] or [OpenType][].  For
26 the web, where bandwidth is important, there is the [Web Open Font
27 Format][WOFF] (WOFF), which compresses the desktop formats.  I've
28 written a simple script ([[font-reduce]]) that uses FontForge to
29 convert subsets of fonts to WOFF for use on the web.
30
31 Console fonts
32 =============
33
34     $ setfont /usr/share/consolefonts/gr737b-9x16-medieval.psfu.gz
35
36 On [[Gentoo]] you can set the default in `/etc/conf.d/consolefont`.
37
38 Authoring fonts
39 ===============
40
41 The main open source tool seems to be [FontForge][].
42                 
43 Further reading
44 ===============
45
46 There are more details about [fonts on Linux][arch] on the Arch wiki
47 page.  Kevin Bowling also has some interesting notes about
48 [configuring fontconfig][KB].  Finally, Nice Web Type has notes about
49 [using fonts on the web][NWT].
50
51
52 [fontconfig]: http://fontconfig.org/
53 [gucharmap]: http://live.gnome.org/Gucharmap
54 [OFL]: http://openfontlibrary.org/
55 [TrueType]: http://en.wikipedia.org/wiki/TrueType
56 [OpenType]: http://en.wikipedia.org/wiki/OpenType
57 [WOFF]: http://en.wikipedia.org/wiki/Web_Open_Font_Format
58 [FontForge]: http://fontforge.sourceforge.net/
59 [arch]: https://wiki.archlinux.org/index.php/Fonts
60 [KB]: http://www.kev009.com/wp/2009/12/getting-beautiful-fonts-in-gentoo-linux/
61 [NWT]: http://nicewebtype.com/notes/2009/10/30/how-to-use-css-font-face/