diff --git a/ChangeLog b/ChangeLog index acf60fa2..6c6ef11d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-12-10 Markus Gans + * PC encoding: Avoid to print ASCII sign 0x00..0x1f in xterm + * Newfont Bullet sign + 2015-12-08 Markus Gans * Add "menu" example to demonstrate the behavior from FMenuBar, FMenu, FMenuItem, FCheckMenuItem and FRadioMenuItem widgets. diff --git a/doc/xgraphics b/doc/xgraphics index cfd5898f..c102bd63 100644 --- a/doc/xgraphics +++ b/doc/xgraphics @@ -10,9 +10,9 @@ Unicode Box Drawing graphics VT100 line drawing graphics (used by xterm, rxvt, ...) -codes `abcdefghijklmnopqrstuvwxyz{|}~ -with G1 )0`abcdefghijklmnopqrstuvwxyz{|}~ -with G0 (0`abcdefghijklmnopqrstuvwxyz{|}~(B +codes +,-.0_`abcdefghijklmnopqrstuvwxyz{|}~ +with G1 )0+,-.0_`abcdefghijklmnopqrstuvwxyz{|}~ +with G0 (0+,-.0_`abcdefghijklmnopqrstuvwxyz{|}~(B VGA graphics, switching to "active codepage" (used by cygwin console, Linux console) diff --git a/src/fenum.h b/src/fenum.h index 3ee5dcfc..cb2760cf 100644 --- a/src/fenum.h +++ b/src/fenum.h @@ -166,6 +166,7 @@ class fc NF_rev_down_pointing_triangle2 = 0x1ae9, // ◤ NF_rev_menu_button3 = 0x1af4, // ] NF_shadow_box_right = 0x1af5, // ] + NF_Bullet = 0x1af9, // ● NF_check_mark = 0x1afb, // ✓ SquareRoot = 0x221a, // √ BlackCircle = 0x25CF // ● diff --git a/src/fmenu.cpp b/src/fmenu.cpp index c2a5a1ae..7ba94c45 100644 --- a/src/fmenu.cpp +++ b/src/fmenu.cpp @@ -642,14 +642,17 @@ void FMenu::drawItems() { if ( is_radio_btn ) { - print (fc::BlackCircle); // BlackCircle ● + if ( isNewFont() ) + print (fc::NF_Bullet); + else + print (fc::BlackCircle); // BlackCircle ● } else { if ( isNewFont() ) print (fc::NF_check_mark); else - print (fc::SquareRoot); + print (fc::SquareRoot); // SquareRoot √ } } else @@ -716,6 +719,7 @@ void FMenu::drawItems() if ( len > 0 ) { FString spaces (len, wchar_t(' ')); + // BlackRightPointingPointer ► print (spaces + wchar_t(fc::BlackRightPointingPointer)); to_char = int(maxItemWidth) - (c + 2); } diff --git a/src/fonts/8x16graph.bdf b/src/fonts/8x16graph.bdf index 5aea1cb3..70288fdb 100644 --- a/src/fonts/8x16graph.bdf +++ b/src/fonts/8x16graph.bdf @@ -5748,13 +5748,13 @@ BITMAP 00 00 00 -00 -00 -00 -18 -18 -00 -00 +38 +7C +FE +FE +FE +7C +38 00 00 00 diff --git a/src/fonts/8x16graph.pcf.gz b/src/fonts/8x16graph.pcf.gz index 35364163..e85766f9 100644 Binary files a/src/fonts/8x16graph.pcf.gz and b/src/fonts/8x16graph.pcf.gz differ diff --git a/src/fonts/newfont.h b/src/fonts/newfont.h index 60041864..e832845a 100644 --- a/src/fonts/newfont.h +++ b/src/fonts/newfont.h @@ -255,7 +255,7 @@ static unsigned char __8x16graph[] = 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, /* 246 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 247 */ 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 248 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 249 */ + 0x00, 0x00, 0x00, 0x00, 0x38, 0x7c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, /* 249 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 250 */ 0x00, 0x03, 0x03, 0x06, 0x06, 0x0c, 0x0c, 0xcc, 0xd8, 0xd8, 0x78, 0x38, 0x00, 0x00, 0x00, 0x00, /* 251 */ 0x00, 0xcc, 0x78, 0x30, 0x30, 0x78, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 252 */ diff --git a/src/fterm.cpp b/src/fterm.cpp index 41e39c5d..60380c84 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -818,6 +818,10 @@ char* FTerm::parseSecDA (char*& current_termtype) { char* new_termtype = current_termtype; + // The Linux console knows no Sec_DA + if ( linux_terminal ) + return new_termtype; + // secondary device attributes (SEC_DA) <- decTerminalID string Sec_DA = new FString(getSecDA()); @@ -1380,6 +1384,13 @@ void FTerm::init() rxvt_terminal = true; } + // Test for Linux console + if ( strncmp(termtype, const_cast("linux"), 5) == 0 + || strncmp(termtype, const_cast("con"), 3) == 0 ) + linux_terminal = true; + else + linux_terminal = false; + // terminal detection... setRawMode(); @@ -1399,13 +1410,6 @@ void FTerm::init() else xterm = false; - // Test for Linux console - if ( strncmp(termtype, const_cast("linux"), 5) == 0 - || strncmp(termtype, const_cast("con"), 3) == 0 ) - linux_terminal = true; - else - linux_terminal = false; - // set the new environment variable TERM if ( new_termtype ) { @@ -3665,6 +3669,7 @@ FString FTerm::getSecDA() putchar(0x5b); // [ putchar(0x3e); // > putchar(0x63); // c + fflush(stdout); usleep(150000); // min. wait time 150 ms (need for mintty) @@ -4252,7 +4257,17 @@ int FTerm::putchar_PC (register int c) ch = char(c); if ( xterm && utf8_console ) - ret = putchar_UTF8(ch & 0xff); + { + if ( uChar(ch) < 0x20 ) // Character 0x00..0x1f + { + Encoding = fc::ASCII; + ch = uChar(charEncode(uInt(c))); + Encoding = fc::PC; + ret = putchar(ch); + } + else + ret = putchar_UTF8(ch & 0xff); + } else ret = putchar(ch); diff --git a/test/ui.cpp b/test/ui.cpp index c88b86dc..8ba2bda1 100644 --- a/test/ui.cpp +++ b/test/ui.cpp @@ -210,10 +210,9 @@ MyDialog::MyDialog (FWidget* parent) Edit->setStatusbarMessage ("Cut-and-paste editing commands"); FMenu* View = new FMenu ("&View", Menubar); View->setStatusbarMessage ("Show internal informations"); - //FMenuItem* Options = new FMenuItem ("&Options", Menubar); - FMenu* Options = new FMenu ("&Options", Menubar); + FMenuItem* Options = new FMenuItem ("&Options", Menubar); Options->setStatusbarMessage ("Set program defaults"); - //Options->setDisable(); + Options->setDisable(); FMenuItem* Help = new FMenuItem ("&Help", Menubar); Help->setStatusbarMessage ("Show version and copyright information"); @@ -257,15 +256,6 @@ MyDialog::MyDialog (FWidget* parent) FMenuItem* Drive = new FMenuItem ("&Drive symbols...", View); Drive->setStatusbarMessage ("Show drive symbols"); - // "Options" menu items - FCheckMenuItem* aa = new FCheckMenuItem ("Disk &Status", Options); - aa->setStatusbarMessage ("1"); - aa->setChecked(); - FRadioMenuItem* bb = new FRadioMenuItem ("&Quick View", Options); - bb->setStatusbarMessage ("2"); - FRadioMenuItem* cc = new FRadioMenuItem ("&Baumstrucktur", Options); - cc->setStatusbarMessage ("3"); - // Menu function callbacks Open->addCallback (