Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 May 1995 21:22:29 +0700
From:      "Nickolay N. Dudorov" <nnd@gw.itfs.nsk.su>
To:        hackers@FreeBSD.org
Subject:   Re: Multi-lingual support in sysinstall (TODO-2.0.5)
Message-ID:  <199505191422.VAA02267@gw.itfs.nsk.su>

next in thread | raw e-mail | index | archive | help
 "Andrey A. Chernov, Black Mage" <ache@astral.msk.su>
    writes:

>>4) In Russian case there is no need in 'screenmap' if you
>>   use koi8-r-8x16 font (and it seems right for me);
>
>Do you really look at semigraphics with koi8-r font?
>It is broken in last (9) pixel, it is standard VGA
>hardware braindamage. Why do you think russians use cp866 fonts
>with screenmap? Please fix this place to use cp866 with koi8-r->cp866
>screenmap.

	Here I must agree with Andrey - with cp866 Russian
screens looks better (same quality as English with cp850 and
better then other languages ;).

>>5) For screens look fine you must not only change
>>   TERM and TERMCAP in environment but also (re)setterm
>>   and especially 'init_acs'.
>>   This present another problem - setterm breaks shell_mode
>>   (sets noecho), so I find some ugly hack to prevent this.
>>   Sombody with better understanding of dialog, ncurses and
>>   mytinfo can find better solution.
>
>What exactly you mean by "breaks shell mode", please
>specify code flow in maximal detailed level.

	I mean that after 'setterm' call in systemChangeTerminal
escaping to shell gives you '-echo' mode. In "usual life" setterm
is called only once in the very beginning of curses initialization
and therefore we have no such problems.

>
>>-    systemChangeFont(font_koi8_r_8x14);
>>+    systemChangeFont(font_koi8_r_8x16);
>
>There must be font_cp866_8x16 instead.
>
>>-    systemChangeScreenmap(koi8_r2cp866);
>>+/*    systemChangeScreenmap(koi8_r2cp866);    */
>
>This change must be reverted back.
>
>Jordan, please, apply my fix.


	  I see NO fix here :-^

... and here is my new version of changes for multi-lingual support:

===================================================================
diff -u sysinstall-old/Makefile sysinstall/Makefile
--- sysinstall-old/Makefile	Fri May 19 19:50:36 1995
+++ sysinstall/Makefile	Fri May 19 20:20:37 1995
@@ -70,10 +70,15 @@
 		&& file2c 'const u_char font_cp850_8x16[] = {' '};' \
 		< cp850-8x16 >> makedevs.tmp
 	rm cp850-8x16
-	uudecode < ${.CURDIR}/../../share/syscons/fonts/koi8-r-8x16.fnt \
-		&& file2c 'const u_char font_koi8_r_8x16[] = {' '};' \
-		< koi8-r-8x16 >> makedevs.tmp
-	rm koi8-r-8x16
+	uudecode < ${.CURDIR}/../../share/syscons/fonts/cp866-8x16.fnt \
+		&& file2c 'const u_char font_cp866_8x16[] = {' '};' \
+		< cp866-8x16 >> makedevs.tmp
+	rm cp866-8x16
+	${.CURDIR}/../../share/syscons/scrnmaps/obj/koi8-r2cp866.mk \
+		koi8-r2cp866 \
+		&& file2c 'const u_char koi8_r2cp866[] = {' '};' \
+		< koi8-r2cp866 >> makedevs.tmp
+	rm koi8-r2cp866
 	mv makedevs.tmp makedevs.c
 
 rtermcap:	${.CURDIR}/rtermcap.c
Common subdirectories: sysinstall-old/help and sysinstall/help
diff -u sysinstall-old/lang.c sysinstall/lang.c
--- sysinstall-old/lang.c	Fri May 19 19:50:37 1995
+++ sysinstall/lang.c	Fri May 19 20:03:46 1995
@@ -43,11 +43,14 @@
 
 #include "sysinstall.h"
 
+u_char default_scrnmap[256];
+
 void
 lang_set_Danish(char *str)
 {
     systemChangeFont(font_iso_8x16);
     systemChangeLang("da_DK.ISO8859-1");
+    systemChangeScreenmap(default_scrnmap);	
     systemChangeTerminal("cons25l1", termcap_cons25l1,
 			 "cons25l1-m", termcap_cons25l1_m);
 }
@@ -57,6 +60,7 @@
 {
     systemChangeFont(font_iso_8x16);
     systemChangeLang("nl_NL.ISO8859-1");
+    systemChangeScreenmap(default_scrnmap);	
     systemChangeTerminal("cons25l1", termcap_cons25l1,
 			 "cons25l1-m", termcap_cons25l1_m);
 }
@@ -66,6 +70,7 @@
 {
     systemChangeFont(font_cp850_8x16);
     systemChangeLang("en_US.ISO8859-1");
+    systemChangeScreenmap(default_scrnmap);	
     systemChangeTerminal("cons25", termcap_cons25,
 			 "cons25-m", termcap_cons25_m);
 }
@@ -75,6 +80,7 @@
 {
     systemChangeFont(font_iso_8x16);
     systemChangeLang("fr_FR.ISO8859-1");
+    systemChangeScreenmap(default_scrnmap);	
     systemChangeTerminal("cons25l1", termcap_cons25l1,
 			 "cons25l1-m", termcap_cons25l1_m);
 }
@@ -84,6 +90,7 @@
 {
     systemChangeFont(font_iso_8x16);
     systemChangeLang("de_DE.ISO8859-1");
+    systemChangeScreenmap(default_scrnmap);	
     systemChangeTerminal("cons25l1", termcap_cons25l1,
 			 "cons25l1-m", termcap_cons25l1_m);
 }
@@ -93,6 +100,7 @@
 {
     systemChangeFont(font_iso_8x16);
     systemChangeLang("it_IT.ISO8859-1");
+    systemChangeScreenmap(default_scrnmap);	
     systemChangeTerminal("cons25l1", termcap_cons25l1,
 			 "cons25l1-m", termcap_cons25l1_m);
 }
@@ -103,6 +111,7 @@
 {
     systemChangeFont(font_iso_8x16);
     systemChangeLang("ja_JP.ROMAJI");
+    systemChangeScreenmap(default_scrnmap);	
     systemChangeTerminal("cons25", termcap_cons25,
 			 "cons25-m", termcap_cons25_m);
 }
@@ -112,6 +121,7 @@
 {
     systemChangeFont(font_iso_8x16);
     systemChangeLang("no_NO.ISO8859-1");
+    systemChangeScreenmap(default_scrnmap);	
     systemChangeTerminal("cons25l1", termcap_cons25l1,
 			 "cons25l1-m", termcap_cons25l1_m);
 }
@@ -119,8 +129,9 @@
 void
 lang_set_Russian(char *str)
 {
-    systemChangeFont(font_koi8_r_8x16);
+    systemChangeFont(font_cp866_8x16);
     systemChangeLang("ru_SU.KOI8-R");
+    systemChangeScreenmap(koi8_r2cp866);	
     systemChangeTerminal("cons25r", termcap_cons25r,
 			 "cons25r-m", termcap_cons25r_m);
 }
@@ -130,6 +141,7 @@
 {
     systemChangeFont(font_iso_8x16);
     systemChangeLang("es_ES.ISO8859-1");
+    systemChangeScreenmap(default_scrnmap);	
     systemChangeTerminal("cons25l1", termcap_cons25l1,
 			 "cons25l1-m", termcap_cons25l1_m);
 }
@@ -139,6 +151,7 @@
 {
     systemChangeFont(font_iso_8x16);
     systemChangeLang("sv_SV.ISO8859-1");
+    systemChangeScreenmap(default_scrnmap);	
     systemChangeTerminal("cons25l1", termcap_cons25l1,
 			 "cons25l1-m", termcap_cons25l1_m);
 }
diff -u sysinstall-old/menus.c sysinstall/menus.c
--- sysinstall-old/menus.c	Fri May 19 19:50:36 1995
+++ sysinstall/menus.c	Fri May 19 20:30:38 1995
@@ -133,7 +133,7 @@
 	DMENU_CALL, (void *)lang_set_Japanese, 0, 0	},
       { "Norwegian", "Norwegian language and character set (ISO-8859-1)", /* N */
 	DMENU_CALL, (void *)lang_set_Norwegian, 0, 0	},
-      { "Russian", "Russian language and character set (cp866-8x14)",	/* R */
+      { "Russian", "Russian language and character set (cp866)",	/* R */
 	DMENU_CALL, (void *)lang_set_Russian, 0, 0	},
       { "Spanish", "Spanish language and character set (ISO-8859-1)",	/* S */
 	DMENU_CALL, (void *)lang_set_Spanish, 0, 0	},
diff -u sysinstall-old/sysinstall.h sysinstall/sysinstall.h
--- sysinstall-old/sysinstall.h	Fri May 19 19:50:36 1995
+++ sysinstall/sysinstall.h	Fri May 19 20:11:39 1995
@@ -281,7 +281,9 @@
 extern const char	termcap_cons25l1_m[];
 extern const u_char	font_iso_8x16[];
 extern const u_char	font_cp850_8x16[];
-extern const u_char	font_koi8_r_8x16[];
+extern const u_char	font_cp866_8x16[];
+extern const u_char	koi8_r2cp866[];
+extern u_char	default_scrnmap[];
 
 /* media.c */
 extern int	mediaSetCDROM(char *str);
diff -u sysinstall-old/system.c sysinstall/system.c
--- sysinstall-old/system.c	Fri May 19 19:50:36 1995
+++ sysinstall/system.c	Fri May 19 20:09:20 1995
@@ -75,6 +75,11 @@
 	setbuf(stderr, 0);
     }
 
+    {
+	int i;
+	for(i=0;i<256;i++) default_scrnmap[i] = i;
+    }
+
     if (set_termcap() == -1) {
 	printf("Can't find terminal entry\n");
 	exit(-1);
@@ -255,6 +260,16 @@
 	    cbreak(); noecho();
 	    dialog_clear();
 	}
+    }
+}
+
+void
+systemChangeScreenmap(const u_char newmap[])
+{
+    if (OnVTY) {
+	if (ioctl(0, PIO_SCRNMAP, newmap) < 0)
+	    msgConfirm("Sorry!  Unable to load the screenmap for %s",
+		       getenv("LANG"));
     }
 }




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199505191422.VAA02267>