From owner-freebsd-hackers Thu May 18 05:55:48 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id FAA07290 for hackers-outgoing; Thu, 18 May 1995 05:55:48 -0700 Received: from gw.itfs.nsk.su (gw.itfs.nsk.su [193.124.36.33]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id FAA07275 for ; Thu, 18 May 1995 05:54:53 -0700 Received: (nnd@localhost) by gw.itfs.nsk.su (8.6.12/8.6.12) id TAA26280 for hackers@freebsd.org; Thu, 18 May 1995 19:54:24 +0700 Date: Thu, 18 May 1995 19:54:24 +0700 From: "Nickolay N. Dudorov" Message-Id: <199505181254.TAA26280@gw.itfs.nsk.su> To: hackers@FreeBSD.org Subject: Multi-lingual support in sysinstall (TODO-2.0.5) Sender: hackers-owner@FreeBSD.org Precedence: bulk This is what I found about multi-lingual support in sysinstall. 1) Standard VGA fonts in syscons are 8x16 and not 8x14 as used in sysinstall now; 2) Font files in .../share/syscons/fonts are uuencoded, so they must be 'uudecode'-d before 'file2c'-ed ; 3) Default (English) case contains (small :) bug - there must be font_cp850_8x16 instead of "font_cp850_8x14" (i.e. you must 'dequote' it ;-) ; 4) In Russian case there is no need in 'screenmap' if you use koi8-r-8x16 font (and it seems right for me); 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. Here is my diffs. I work with yesterday's sources, so this diff can't be used as a patch, but you can see what and how I've done. N.Dudorov ================================================================== diff -u sysinstall-old/Makefile sysinstall/Makefile --- sysinstall-old/Makefile Thu May 18 12:37:08 1995 +++ sysinstall/Makefile Thu May 18 14:15:49 1995 @@ -62,15 +62,18 @@ ./rtermcap vt100 | \ file2c 'const char termcap_vt100[] = {' ',0};' \ >> makedevs.tmp - file2c 'const u_char font_iso_8x14[] = {' '};' \ - < ${.CURDIR}/../../share/syscons/fonts/iso-8x14.fnt \ + uudecode < ${.CURDIR}/../../share/syscons/fonts/iso-8x16.fnt + file2c 'const u_char font_iso_8x16[] = {' '};' < iso-8x16 \ >> makedevs.tmp - file2c 'const u_char font_cp850_8x14[] = {' '};' \ - < ${.CURDIR}/../../share/syscons/fonts/cp850-8x14.fnt \ + rm iso-8x16 + uudecode < ${.CURDIR}/../../share/syscons/fonts/cp850-8x16.fnt + file2c 'const u_char font_cp850_8x16[] = {' '};' < cp850-8x16 \ >> makedevs.tmp - file2c 'const u_char font_koi8_r_8x14[] = {' '};' \ - < ${.CURDIR}/../../share/syscons/fonts/koi8-r-8x14.fnt \ + 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 file2c 'const u_char koi8_r2cp866[] = {' '};' \ < ${.CURDIR}/../../share/syscons/scrnmaps/koi8-r2cp866 \ >> makedevs.tmp Common subdirectories: sysinstall-old/help and sysinstall/help diff -u sysinstall-old/lang.c sysinstall/lang.c --- sysinstall-old/lang.c Sun May 7 23:02:28 1995 +++ sysinstall/lang.c Thu May 18 15:28:15 1995 @@ -46,7 +46,7 @@ void lang_set_Danish(char *str) { - systemChangeFont(font_iso_8x14); + systemChangeFont(font_iso_8x16); systemChangeLang("da_DK.ISO8859-1"); systemChangeTerminal("cons25l1", termcap_cons25l1, "cons25l1-m", termcap_cons25l1_m); @@ -55,7 +55,7 @@ void lang_set_Dutch(char *str) { - systemChangeFont(font_iso_8x14); + systemChangeFont(font_iso_8x16); systemChangeLang("nl_NL.ISO8859-1"); systemChangeTerminal("cons25l1", termcap_cons25l1, "cons25l1-m", termcap_cons25l1_m); @@ -64,7 +64,7 @@ void lang_set_English(char *str) { - systemChangeFont("font_cp850_8x14"); + systemChangeFont(font_cp850_8x16); systemChangeLang("en_US.ISO8859-1"); systemChangeTerminal("cons25", termcap_cons25, "cons25-m", termcap_cons25_m); @@ -73,7 +73,7 @@ void lang_set_French(char *str) { - systemChangeFont(font_iso_8x14); + systemChangeFont(font_iso_8x16); systemChangeLang("fr_FR.ISO8859-1"); systemChangeTerminal("cons25l1", termcap_cons25l1, "cons25l1-m", termcap_cons25l1_m); @@ -82,7 +82,7 @@ void lang_set_German(char *str) { - systemChangeFont(font_iso_8x14); + systemChangeFont(font_iso_8x16); systemChangeLang("de_DE.ISO8859-1"); systemChangeTerminal("cons25l1", termcap_cons25l1, "cons25l1-m", termcap_cons25l1_m); @@ -91,7 +91,7 @@ void lang_set_Italian(char *str) { - systemChangeFont(font_iso_8x14); + systemChangeFont(font_iso_8x16); systemChangeLang("it_IT.ISO8859-1"); systemChangeTerminal("cons25l1", termcap_cons25l1, "cons25l1-m", termcap_cons25l1_m); @@ -101,7 +101,7 @@ void lang_set_Japanese(char *str) { - systemChangeFont(font_iso_8x14); + systemChangeFont(font_iso_8x16); systemChangeLang("ja_JP.ROMAJI"); systemChangeTerminal("cons25", termcap_cons25, "cons25-m", termcap_cons25_m); @@ -110,7 +110,7 @@ void lang_set_Norwegian(char *str) { - systemChangeFont(font_iso_8x14); + systemChangeFont(font_iso_8x16); systemChangeLang("no_NO.ISO8859-1"); systemChangeTerminal("cons25l1", termcap_cons25l1, "cons25l1-m", termcap_cons25l1_m); @@ -119,9 +119,9 @@ void lang_set_Russian(char *str) { - systemChangeFont(font_koi8_r_8x14); + systemChangeFont(font_koi8_r_8x16); systemChangeLang("ru_SU.KOI8-R"); - systemChangeScreenmap(koi8_r2cp866); +/* systemChangeScreenmap(koi8_r2cp866); */ systemChangeTerminal("cons25r", termcap_cons25r, "cons25r-m", termcap_cons25r_m); } @@ -129,7 +129,7 @@ void lang_set_Spanish(char *str) { - systemChangeFont(font_iso_8x14); + systemChangeFont(font_iso_8x16); systemChangeLang("es_ES.ISO8859-1"); systemChangeTerminal("cons25l1", termcap_cons25l1, "cons25l1-m", termcap_cons25l1_m); @@ -138,7 +138,7 @@ void lang_set_Swedish(char *str) { - systemChangeFont(font_iso_8x14); + systemChangeFont(font_iso_8x16); systemChangeLang("sv_SV.ISO8859-1"); systemChangeTerminal("cons25l1", termcap_cons25l1, "cons25l1-m", termcap_cons25l1_m); diff -u sysinstall-old/menus.c sysinstall/menus.c --- sysinstall-old/menus.c Thu May 18 12:37:10 1995 +++ sysinstall/menus.c Thu May 18 19:10:10 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 (koi8-r)", /* 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 Thu May 18 12:37:10 1995 +++ sysinstall/sysinstall.h Thu May 18 12:57:54 1995 @@ -279,9 +279,9 @@ extern const char termcap_cons25r_m[]; extern const char termcap_cons25l1[]; extern const char termcap_cons25l1_m[]; -extern const u_char font_iso_8x14[]; -extern const u_char font_cp850_8x14[]; -extern const u_char font_koi8_r_8x14[]; +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 koi8_r2cp866[]; /* media.c */ diff -u sysinstall-old/system.c sysinstall/system.c --- sysinstall-old/system.c Thu May 18 12:37:10 1995 +++ sysinstall/system.c Thu May 18 18:51:59 1995 @@ -221,7 +221,7 @@ systemChangeFont(const u_char font[]) { if (OnVTY) { - if (ioctl(0, PIO_FONT8x14, font) < 0) + if (ioctl(0, PIO_FONT8x16, font) < 0) msgConfirm("Sorry! Unable to load font for %s", getenv("LANG")); } } @@ -240,12 +240,20 @@ if (ColorDisplay) { setenv("TERM", color, 1); setenv("TERMCAP", c_term, 1); - /* setterm(color); */ + reset_shell_mode(); + setterm(color); + init_acs(); + cbreak(); + noecho(); } else { setenv("TERM", mono, 1); setenv("TERMCAP", m_term, 1); - /* setterm(mono); */ + reset_shell_mode(); + setterm(mono); + init_acs(); + cbreak(); + noecho(); } } }