Andrey Bushman asked:
But what about BIOS? It works before the OS and displays the text too. BIOS knows nothing about the GDI, as I understand. And... How GDI does it?
BIOS has its own fonts. More exactly, the portion of the BIOS stored in each graphics card. The fonts can be modified by filling in the BIOS tables dedicated to this information and BIOS calls. The cards has the text mode where these fonts are used.
None of that is used in the modern OS based on graphics, but those fonts are used when the OS is only running some of its bootstrap phases, or in some OS configured for uses as service host. This is the case for server's configurations of Linux. But who needs fonts in such service applications? Most people mostly remember those text modes from DOS times…
I, for example, know how to work with all those graphics card modes, but, at this moment, don't know where the documentation can be found on the Web. (I don't think you are asking about it, anyway.) The application could change the fonts on the fly, very quickly. Such tricks were used, for example, to simulate pixel-accuracy mouse, by changing the fonts of the characters where the mouse is located (4 or less at a time).
Also remember that modern OS use Unicode. BIOS does not. The text modes of graphic cards are pretty much obsolete, only used for very basic functionality.
And note that the concept of BIOS itself may become obsolete, being eventually superseded by EFI. Please see:
http://en.wikipedia.org/wiki/BIOS[
^],
http://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface[
^].
—SA