From 5708ac56990ebd71e98334e3929bbfaa9e56435d Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sat, 17 Oct 2015 21:05:49 +0200 Subject: [PATCH] Newfont characters are now printable in FLabel, FMenuBar and FMenu --- ChangeLog | 1 + src/flabel.cpp | 8 +++++++- src/fmenu.cpp | 8 +++++++- src/fmenubar.cpp | 8 +++++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 24e94499..605fb0fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2015-10-17 Markus Gans * More faster header inline code * Improve getXTermFont() and getXTermTitle() + * Newfont characters are now printable in FLabel, FMenuBar and FMenu. 2015-10-16 Markus Gans * Fixed: calculator behavior for negative values diff --git a/src/flabel.cpp b/src/flabel.cpp index 104b72e2..b7be4021 100644 --- a/src/flabel.cpp +++ b/src/flabel.cpp @@ -181,7 +181,13 @@ void FLabel::printLine ( wchar_t*& line for (int z=0; z < to_char; z++) { if ( ! iswprint(wint_t(line[z])) ) - line[z] = L' '; + { + if ( ! isNewFont() && ( int(line[z]) < fc::NF_rev_left_arrow2 + || int(line[z]) > fc::NF_check_mark ) ) + { + line[z] = L' '; + } + } if ( (z == hotkeypos) && isActive ) { setColor (wc.label_hotkey_fg, wc.label_hotkey_bg); diff --git a/src/fmenu.cpp b/src/fmenu.cpp index 774009c0..0f246876 100644 --- a/src/fmenu.cpp +++ b/src/fmenu.cpp @@ -339,7 +339,13 @@ void FMenu::drawItems() for (int z=0; z < to_char; z++) { if ( ! iswprint(wint_t(item_text[z])) ) - item_text[z] = L' '; + { + if ( ! isNewFont() && ( int(item_text[z]) < fc::NF_rev_left_arrow2 + || int(item_text[z]) > fc::NF_check_mark ) ) + { + item_text[z] = L' '; + } + } if ( (z == hotkeypos) && is_Active && ! is_Selected ) { setColor (wc.menu_hotkey_fg, wc.menu_hotkey_bg); diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp index 927c4492..6f5410af 100644 --- a/src/fmenubar.cpp +++ b/src/fmenubar.cpp @@ -201,7 +201,13 @@ void FMenuBar::drawItems() for (int z=0; z < to_char; z++) { if ( ! iswprint(wint_t(item_text[z])) ) - item_text[z] = L' '; + { + if ( ! isNewFont() && ( int(item_text[z]) < fc::NF_rev_left_arrow2 + || int(item_text[z]) > fc::NF_check_mark ) ) + { + item_text[z] = L' '; + } + } if ( (z == hotkeypos) && is_Active && ! is_Selected ) { setColor (wc.menu_hotkey_fg, wc.menu_hotkey_bg);