Small NewFont improvements

This commit is contained in:
Markus Gans 2017-11-03 05:04:27 +01:00
parent 19c8dd50a9
commit 1bf4f2f906
9 changed files with 74 additions and 30 deletions

View File

@ -33,7 +33,8 @@ The C++ class design was inspired by the Qt framework. It provides common contro
newfont
-------
A new text font for X11 and the Linux console.
A [graphical text font](fonts/) for X11 and the Linux console.
![](doc/newfont1.png)
![](doc/newfont2.png)
@ -204,3 +205,8 @@ Class digramm
└──┤ FRadioMenuItem ├---┘
└────────────────┘
</pre>
Please send bug reports to
--------------------------
https://github.com/gansm/finalcut/issues

View File

@ -410,6 +410,20 @@ void MouseDraw::draw()
int y_max = getHeight();
FDialog::draw();
setColor();
if ( isNewFont() )
{
for (int y = 2; y < y_max; y++)
{
setPrintPos (10, y);
print (wchar_t(fc::NF_rev_border_line_right));
}
setPrintPos (10, y_max);
print (wchar_t(fc::NF_rev_border_corner_lower_right));
}
else
{
setPrintPos (10, 2);
print (wchar_t(fc::BoxDrawingsDownAndHorizontal));
@ -421,6 +435,8 @@ void MouseDraw::draw()
setPrintPos (10, y_max);
print (wchar_t(fc::BoxDrawingsUpAndHorizontal));
}
drawCanvas();
}

View File

@ -10,7 +10,7 @@ the terminal emulators
or
[urxvt](http://software.schmorp.de/pkg/rxvt-unicode.html),
because only these terminal emulators can change the font by
using an escape sequence. For an xterm, the "[Allow Font Ops](doc/xterm.txt)"
using an escape sequence. For an xterm, the "[Allow Font Ops](../doc/xterm.txt)"
option must be set.
#### Install the gzip compressed X11 pcf bitmap font 8x16graph.pcf.gz on your xserver:

View File

@ -1,5 +1,6 @@
#!/bin/bash
test -f 8x16graph.pcf.gz && rm 8x16graph.pcf.gz
bdftopcf -o 8x16graph.pcf 8x16graph.bdf
gzip -9 8x16graph.pcf

View File

@ -2,3 +2,6 @@
8x16graph -misc-8x16graph-medium-r-normal--17-160-75-75-p-80-iso8859-1
-misc-8x16graph-medium-r-normal--17-160-75-75-p-80-ibm-cp437 -misc-8x16graph-medium-r-normal--17-160-75-75-p-80-iso8859-1
!----------------------------------------
! Note: urxvt can't load a ibm-cp437 font
!----------------------------------------

View File

@ -546,6 +546,7 @@ void FButtonGroup::drawLabel()
i++;
src++;
}
*dest++ = *src++;
}

View File

@ -733,7 +733,7 @@ void FListView::onKeyPress (FKeyEvent* ev)
case fc::Fkey_left:
if ( xoffset == 0 )
{
if ( item->isExpandable() && item->isExpand() )
if ( tree_view && item->isExpandable() && item->isExpand() )
{
// Collapse element
item->collapse();
@ -784,7 +784,7 @@ void FListView::onKeyPress (FKeyEvent* ev)
break;
case fc::Fkey_right:
if ( item->isExpandable() && ! item->isExpand() )
if ( tree_view && item->isExpandable() && ! item->isExpand() )
{
// Expand element
item->expand();
@ -841,15 +841,21 @@ void FListView::onKeyPress (FKeyEvent* ev)
break;
case int('+'):
if ( tree_view && item->isExpandable() && ! item->isExpand() )
{
item->expand();
adjustSize();
ev->accept();
}
break;
case int('-'):
if ( tree_view && item->isExpandable() && item->isExpand() )
{
item->collapse();
adjustSize();
ev->accept();
}
break;
default:
@ -1093,7 +1099,7 @@ void FListView::onMouseDoubleClick (FMouseEvent* ev)
FListViewItem* item = getCurrentItem();
if ( item->isExpandable() )
if ( tree_view && item->isExpandable() )
{
if ( item->isExpand() )
item->collapse();
@ -1549,7 +1555,7 @@ void FListView::drawColumnLabels()
first = h.begin() + xoffset;
if ( int(h.size()) <= getClientWidth() )
last = h.end() - 1;
last = h.end();// - 1;
else
{
int len = getClientWidth() + xoffset - 1;

View File

@ -89,7 +89,8 @@ void FToggleButton::setGeometry (int x, int y, int w, int h, bool adjust)
{
// Set the toggle button geometry
int min_width = button_width + int(text.getLength());
int hotkey_mark = ( getHotkey() ) ? 1 : 0;
int min_width = button_width + int(text.getLength()) - hotkey_mark;
if ( w < min_width )
w = min_width;
@ -199,7 +200,9 @@ bool FToggleButton::setChecked (bool on)
void FToggleButton::setText (const FString& txt)
{
text = txt;
setWidth(button_width + int(text.getLength()));
int hotkey_mark = ( getHotkey() ) ? 1 : 0;
setWidth(button_width + int(text.getLength()) - hotkey_mark);
if ( isEnabled() )
{

View File

@ -2737,9 +2737,17 @@ inline void FVTerm::charsetChanges (char_data*& next_char)
else if ( Encoding == fc::PC )
{
next_char->attr.bit.pc_charset = true;
// Character 0x00..0x1f
if ( isXTerminal() && hasUTF8() && ch_enc < 0x20 )
if ( isXTerminal() && ch_enc < 0x20 ) // Character 0x00..0x1f
{
if ( hasUTF8() )
next_char->code = int(charEncode(code, fc::ASCII));
else
{
next_char->code += 0x5f;
next_char->attr.bit.alt_charset = true;
}
}
}
}
}