Questions about fbterm's usage in Slint or Slackware installer
I want to be able to display Chinese characters in Slint installer (that could benefit to the genuine Slackware installer in the future :-)
Of course we can't use a console font in a Linux console for that, as we need to be able to display thousands of characters.
And I won't consider shipping an X server inside the installer ;)
But a volunteer to do Chinese translation told me that I could use fbterm instead.
He's right and fortunately fbterm can work either on top of a framebuffer if available, else fallback to vesa, and still use TTF fonts to display tens of thousands of characters.
So far, so good, I made some tries and that seems to work (installing in the installer mainly fbterm + fontconfig + freetype + wqy-zenhei-font-ttf), but I have an open issue and a question.
On the ol'good days, DARKSTAR Linux used to have a graphical installer, written in Qt, called YaLI. One of the YaLI's variants was capable to run directly from framebuffer, and technically launched directly in the installer initrd, from rc.d scripts, as runlevel 4...
But that damn application was a environment nazi, requiring strictly a root console to properly work.
So, the solution was to use SU. If I remember right, something like:
Eventually I closed the issue and answered the question stated in the first post of this thread.
1. Closing the issue
The reason why FbTerm complained "stdin isn't a interactive tty" was that I launched it too soon, i.e. before udev had created the ttys.
To avoid that I made following changes in the installer.
I modified Pat's /etc/inittab, that now begins like this
2. Answering the question
Eventually I don't set the VESA mode (I can do that only if no frame buffer is used anyway), but set the size of the font to optimize usage of the display.
By "optimize" I mean: choose the biggest font size that allows to display at least 90 columns and 26 lines in the terminal, whatever be the display size.
Thanks to ability of FbTerm to work either with a VESA driver or a frame buffer driver, the installer will thus have a similar appearance, regardless of display size or method used for drawing.
To do that I wrote the script /etc/rc.d/SetFont (called by /etc/rc.d/start_rc.S2 and /etc/rc.d/start_FbTerm.sh as well) that finds the greatest available VESA display size (in pixels) and sets the size of the font accordingly. That font size is then set as an optional parameter of the fbterm command.
The appropriate font size for a given display size (e.g. 1024x768) is not computed "on the fly" (doing that is an exercise left to te reader :-) but simply recorded for the display sizes most used in recent years, as retrieved for instance here. In case of an unusual (i.e. not recorded in SetFont) display size, FbTerm's default size is be used.
Of course the optimal font size depends on font's dimensions (width and height), but we will use only two fonts, both mono spaced: DejaVu Sans Mono for most European scripts and WenQuanYi Zen Hei Mono, mostly for CJK (Chinese, Japanese and Korean). Fortunately these fonts are already included in Slackware, thanks Pat.
Those who didn't fell asleep reading this boring post up to this point (congratulations!) and wanting to know more (if any :-) will be able to see the scripts in the ISO installers in directory http://slint.fr/testing. Just mount the ISO file somewhere and unpack the initrd.
I'll post about using the "testing" installers and request help to check the list of usual display sizes in specific threads later.
|All times are GMT -5. The time now is 07:54 AM.|