1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
By Edmund GRIMLEY EVANS <edmundo@rano.org>
Amended by Adam Di Carlo
Updated by Marcin Owsiany
libutf8 can be found in boot-floppies CVS module now, in 'utilities/bf-utf'
directory
I haven't made the file UTF-8-test; instead do echo -e "\304\211" to
get a 'c' with hat, for example.
System requirements
I don't know what the requirements are, but this is what I'm using:
kernel 2.2.14, which I compiled myself and configured to use the
framebuffer console. My /etc/lilo.conf contains the line "vga=771". I
have a cheap motherboard with a Cyrix "i686" processor and on-board
graphics using SiS 5597/8. When the system starts I get a penguin in
the top left of the screen and a text console with 100 columns. I don't
have the bandwidth to dist-upgrade, but I keep things like libc6 and
gcc up-to-date with potato. When I run BOGL I'm using the code in
bogl-pcfb.c with 8 bpp, I think.
The code
If you're not already familiar with boot-floppies, you probably
shouldn't be reading this, but the basic instructions are: install the
latest boot-floppies using apt-get, so that you get other required
packages too, then look in /usr/src/boot-floppies/README-CVS for
instructions on how to get the very latest version from CVS.
Fonts
Get Markus Kuhn's fixed-width BDF fonts with UCS encoding:
http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz
http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts-asian.tar.gz
These fonts are also useful for a UTF-8 xterm. I used 9x18.bdf and
18x18ja.bdf for testing.
Compiling
$ cd /usr/src/boot-floppies/utilities/libutf8
$ make
$ cd /usr/src/boot-floppies/utilities/bogl
$ make bdftobogl bterm
$ ./mergebdf .../9x18.bdf .../18x18ja.bdf > font.bdf
$ ./bdftobogl -b font.bdf > font.bgf
For screen-oriented programs you need a terminfo entry for bterm. Do
the following to check you don't already have an entry for bterm, then
make one in the user's ~/.terminfo/. Either make sure you run bterm as
the same user as you ran tic, or run tic as root to make a terminfo
entry in the system terminfo directory.
$ infocmp bterm
$ tic bterm.ti
$ infocmp bterm
Running
Go to a text console, as I don't know what effect this might have on X,
and:
$ cd /usr/src/boot-floppies/utilities/bogl
$ export LC_CTYPE=eo.UTF-8
$ ./bterm -f font.bgf
You should get a new text console with a disgusting black-on-white
colour scheme. You can check that UTF-8 works with:
$ cat UTF-8-test
Screen handling
Bterm understands a tiny subset of the control sequences that xterm
understands, but sufficient, I hope, for slang, curses and GNU
Readline. (If you want vt100 emulation, you can always run GNU Screen.)
You can test a program's ability to work in a bterm by running it in a
UTF-8 xterm with export TERM=bterm. If you notice any incompatibilites
between bterm and a UTF-8 xterm, please tell me.
For instructions on how to get a UTF-8 xterm, see:
ftp://ftp.ilog.fr/pub/Users/haible/utf8/Unicode-HOWTO.html
Slang and newt
I have patched slang and newt to (partially) work in UTF-8. Get the
code from:
http://www.rano.org/mutt/slang-1.4.0-ege5.diff
http://www.rano.org/mutt/newt-0.50-5.3-ege1.diff
Here's what to do (there's a fixed relative path to ../slang14 in
newt-0.50/Makefile; sorry about that):
$ bzcat /usr/local/src/slang/slang-1.4.0.tar.bz2 | tar xf -
$ mv -i slang-1.4.0 slang14
$ cd slang14
$ patch -p0 < ~/slang-1.4.0-ege5.diff
$ ./configure && make
$ cd ..
$ tar xzf newt_0.50.orig.tar.gz
$ cd newt-0.50
$ zcat newt_0.50-5.3.diff.gz | patch -p1
$ patch -p1 < newt-0.50-5.3-ege1.diff
$ # Using a UTF-8 editor, change the messages in test.c and testgrid.c
# to include lots of exotic characters.
$ ./configure && make testing testgrid
Now, in the bterm (or a UTF-8 xterm):
$ newt-0.25/testing
$ newt-0.25/testgrid
Internationalised boot-floppies
I haven't tried this yet, but I intend to: Convert the PO files to
UTF-8 using the command iconv in a script. Recompile dbootstrap with
language chooser against the patched slang and newt. Include bterm and
a suitable font in root.bin and modify /etc/init.d/ to run dbootstrap
in a bterm. Make sure the kernel on the rescue floppy has a
framebuffer. Et voila, maybe.
There are probably bugs in the patched slang and newt, because they're
not very much tested yet. If you can identify a bug, please send me
details.
|