From ee182220d8b229c98215be75a870d2e1d831ab55 Mon Sep 17 00:00:00 2001 From: Lars Doelle Date: Thu, 29 Oct 1998 04:40:30 +0000 Subject: [PATCH] rolled a "real" linux console font. svn path=/trunk/kdebase/konsole/; revision=11858 --- README.linux.console | 50 ++++++++++++++++++++++------------------- other/linux8x16.pcf.gz | Bin 0 -> 4633 bytes other/makefont.c | 40 +++++++++++++++++++++++++++++++++ src/TEScreen.C | 2 +- src/main.C | 4 ++-- tests/Makefile | 13 +++++++++++ 6 files changed, 83 insertions(+), 26 deletions(-) create mode 100644 other/linux8x16.pcf.gz create mode 100644 other/makefont.c create mode 100644 tests/Makefile diff --git a/README.linux.console b/README.linux.console index 9f73ec7b..ff28f962 100644 --- a/README.linux.console +++ b/README.linux.console @@ -5,43 +5,47 @@ look as pleasant as the original. Konsole has lately improved it's support for the linux console. Especially using the new session mechanism makes running the -linux console under X11 being a snap. +linux console under X11 a snap. Simple choose "Linux console" from the "New" menu (or click the right mouse button while holding down the control key). -To get proper support of graphic characters, you need a VGA font -being installed, too. If a VGA font is not installed on your system, -you may like to use the one supplied in the konsole/other directory. +To get proper support of graphic characters, you need a linux console +font being installed. Proceed as follows: -To install the font proceed as follows: + cp konsole/other/linux8x16.pcf.gz /usr/X11R6/lib/X11/fonts/misc + mkfontdir /usr/X11R6/lib/X11/fonts/misc - cp konsole/other/vga.pcf.gz /usr/X11R6/lib/X11/fonts/misc - mkfontdir /usr/X11R6/lib/X11/fonts/misc +(For some strange reason i had to restart my X server too, to make + it aware of the new font. Try "xfd -fn linux8x16" to see if the + font is available.) Depending on the application, you might need to switch to dark -background, too, for the best results. (Konsole does this -automatically for you when you select the linux console as -suggested above). +background, for the best results. (Konsole does this automatically +for you when you select the linux console as suggested above). Please note that those applications may not react properly on changing the window size. Often they ignore it completely or behave strange in other ways. I even saw one application dying from the shock of noticing that the linux console has simply changed it's size (Debian's dselect). Since the Linux console -can definitely be resized (not only when running the popular -frame buffer console), this behavior is to be considered a bug -within these applications. - -Mouse handling in mc is known not to work when run with TERM=linux -in an xterminal, because of a bug in mc itself. In general, mouse -aware applications might create further trouble because the mouse -is handled differently within the linux console (which uses gpm) -and X11. As soon as konsole has matured a little more, i'll try -to get in contact with the authors of the mouse handling for the -linux console and will try to find out if making a copy/paste between -X11 and gpm is really impossible. The mouse material in the ncurses -is in need of some upgrade also, basically for the same reasons. +can be resized, this behavior is to be considered a bug of +these applications, i cannot help it. + +Mouse-aware application will most probably not recognize +mouse events (especially mc) since they might try to get +these events from gpm instead from the console. + +The linux console can some funny quirks with special graphic +characters and i haven't yet managed to teach Konsole all of +them. In rare cases, they might display differently. Affected +to my knowlegde are especially non-VT100 extentions taken from +the AT&T 4410v1, these are arrow symbols, a full block and a +checker board. Most other tricks that the linux console is +able to do with character sets are eventually not even used +in a single instance, so you will hardly be disturbed by +konsoles inability to do them. Please accept, that i've just +started to support the linux console emulation. Anyway, try diff --git a/other/linux8x16.pcf.gz b/other/linux8x16.pcf.gz new file mode 100644 index 0000000000000000000000000000000000000000..81afb1b25a2e9c040a638f1433b2ca3acae8b938 GIT binary patch literal 4633 zcmai$c{J2}+{Y_P3R4NmcJH;9vhQ1Rqs7oFLky+{F@_@Rj9bDj2_;>77+dx`cA3c% z6&egC24g8R!z`8=%P=#K>G|V1=XOrdd7tz9p6~nn`Mlnr?;pSO`za;v-|sMLY_v-# zz%MW~+$3Dr=yVVSx{ID2lbzP%-edhZEhWvU4k&k3BVQbdk8hZuPfdB)b~gO3S$FKb zP<+>QM&P2*lbaVbOBg5-Vv*N02540@jXpmxIO z%3y&vHEJzl{sE&Ifut#NoHnNxxio#8Ri4j$MurbYf0fo>aW`VI=moU>+>#3I;JWs# zXB=)M+Cx5`jJX)u5gkv~a#2;tRPGPMSaZDmE^Kh4jd0a3FM5TamNARS`W816af>qC z{o8IMjK0!A+zsEwnUQ&U$=+8w~O?7oK1`lTa zuc|wN({gtuE4y*Dlxd)zJ*^I+io>-Rz=1I$L%k?`r*CI6ix z5%;slES9uI5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e*nQCRu-3z( zAO)@1?ICLl(jbo%Qm`@6ka= zbM^hjI(1DX)TdS6?Jb#>G7~41`#a#Ai>|qg z?LDcA`1%?}qxWh}axM9L);pxX9st-_i}gv2=E=v2eie`M)TYI9gLX-D%q{J;5KWlY zG!cW+KPxY3$;XkWBTV-7%+o&X1P;Z2Yxcv-!N@Ru^15qfTPH=q(lw;Y!oohkrFX72yKoBtBn#hxc*<`_292{ ubKuun&u7|_5- linux8x16.bdf + bdftopcf -o linux8x16.pcf linux8x16.bdf + gzip linux8x16.pcf +*/ + +main() +{ int i,j; + printf("STARTFONT 2.1\n"); + printf("COMMENT Linux console font 8x16\n"); + printf("FONT linux8x16\n"); + printf("SIZE 8 75 75\n"); + printf("FONTBOUNDINGBOX 8 16 0 -4\n"); + printf("STARTPROPERTIES 2\n"); + printf("FONT_DESCENT 4\n"); + printf("FONT_ASCENT 12\n"); + printf("ENDPROPERTIES\n"); + printf("CHARS 256\n"); + for (i = 0; i < 256; i++) + { + printf("STARTCHAR x%02x\n",i); + printf("ENCODING %d\n",i); + printf("SWIDTH %d %d\n",0,0); + printf("DWIDTH %d %d\n",8,0); + printf("BBX %d %d %d %d\n",8,16,0,-4); + printf("BITMAP\n"); + for (j = 0; j < 16; j++) + { + printf("%02x\n",(unsigned char)fontdata_8x16[16*i+j]); + } + printf("ENDCHAR x%02x\n",i); + } + printf("ENDFONT\n"); +} diff --git a/src/TEScreen.C b/src/TEScreen.C index c9627194..8545b145 100644 --- a/src/TEScreen.C +++ b/src/TEScreen.C @@ -718,8 +718,8 @@ void TEScreen::ShowCharacter(unsigned char c) if (graphic) // handle graphical character set here { - // if (c == '0') c = ' '; else if (c == 'h') c = ' '; if (c >= 0x5f && c <= 0x7e) c = (c == 0x5f) ? 0x7f : c - 0x5f; + //FIXME: the linux console knows some non-VT100 chars, too. } if (pound && c == '#') c = 0xa3; // pound sign diff --git a/src/main.C b/src/main.C index c4e94702..13a68e74 100644 --- a/src/main.C +++ b/src/main.C @@ -51,7 +51,7 @@ #define WITH_VGA -char *fonts[] = {"6x13", "5x7", "6x10", "7x13", "9x15", "10x20", "vga"}; +char *fonts[] = {"6x13", "5x7", "6x10", "7x13", "9x15", "10x20", "linux8x16"}; //"vga"}; TEDemo::TEDemo(char* args[]) : KTMainWindow() { @@ -180,7 +180,7 @@ void TEDemo::makeMenu() m_font->insertItem( i18n("&Huge"), 5); #ifdef WITH_VGA m_font->insertSeparator(); - m_font->insertItem( i18n("&VGA"), 6); + m_font->insertItem( i18n("&Linux"), 6); #endif #ifdef ANY_FONT m_font->insertSeparator(); diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 00000000..50dc047d --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,13 @@ +CFLAGS = -O +OBJS = main.o esc.o + +vttest: $(OBJS) + cc $(CFLAGS) -o vttest $(OBJS) + +install: vttest + cp vttest.1 /usr/man/man1/vttest.1 + cp vttest /usr/local/bin/vttest + strip /usr/local/bin/vttest + +clean: + rm -f $(OBJS) vttest foo core lint tags a.out