Contributed by pitrh on from the UTF-8 means Use The Force dept.
I was intending to spend b2k13 working on the glass console subsystem, wsdisplay(4), and especially two areas: UTF-8 support on console, and loadable font support for raster displays (i.e. every display but text-mode vga).
I had started to work on UTF-8 support on console some years ago, during another hackathon. That work had never been completed, because of issues when using 8-bit characters while running in non-UTF-8 mode (which is still the default). So my first task was to sit down and fix these issues, which allowed the UTF-8 support code to be committed... and immediately afterwards, exposing bugs in it, mostly in the line editing behaviour when in UTF-8 mode. I'll hopefully be able to address them in the near future.
UTF-8 is however useless if you limit yourself to 256 characters only, which is what the default kernel font on raster displays provides. The next step towards making UTF-8 useful in console, is to allow the user to load more fonts, to be able to display as many Unicode characters as possible. The wscons(4) framework already had a rough tool to load fonts (wsfontload(8)), but it was designed with the text-mode VGA display in mind (which can store multiple fonts in its device memory). So I have started to add font loading support to the raster displays as well, whenever possible. As a bonus, the default font, provided by the kernel, will now appear in the font list reported by the 'wsfontload -l' command.
The final step was to allow for the newly loaded font to be used for display. I have added a `display.font' item to wsconsctl(8), which allows the current font to be selected by name.
There is still a lot of steps missing until we can enjoy UTF-8 console and multiple fonts, and these will hopefully be completed in the near future.
- Creating tools allowing users to create their own console fonts from a Truetype font or an X11 bdf font.
- Allowing multiple fonts of similar metrics to be used simultaneously, with a priority scheme, so that one could for example stick to the kernel font and load a new font only for the Unicode glyphs not available in the default font.
- Adding support for sparse font files. Right now (due to its text-mode VGA roots), font support expects fonts to span a contiguous range of Unicode symbols. This will obviously not scale.
Expect some of this to happen in the near future!
Thank you, Miod for the report and all the good work! We look forward to seeing truly international support in our consoles soon!
(Comments are closed)