Font files are designed to show a particular encoding. The program using a given font has to assume that a value n
in a given encoding is displayed by rendering the corresponding glyph number n
.
Font files need not have glyphs for all possible values of a given character encoding (for Unicode it is rare for a font to cover the whole range), nor need they start with the first value from the encoding (usually the control characters are omitted). There are different file-format schemes for specifying the starting point, ending point and omitted glyphs which are used to keep font file-sizes manageable.
From the example given, the OP is likely using the X Window system. There is more than one file-format used, with corresponding different ways they are accessed. The principal ones are XLFD (older) and fontconfig (newer). With other systems (Microsoft Windows), other APIs are used (the LOGFONT
structure is a good starting point). OSX is another example, with its own API (CoreText).
Those of course are for graphical interfaces. Fonts are more widely applicable than that. For instance, Linux and the BSDs allow one to specify different console fonts — which in addition to encoding, run into limitations on the number of glyphs which are usable. Here are a few useful links for those: