diff --git a/include/printwin.cpp b/include/printwin.cpp index c207c906b..661ee3256 100755 --- a/include/printwin.cpp +++ b/include/printwin.cpp @@ -161,42 +161,49 @@ void TPrintwin::paint_row(long j) const int row = (int)(j % _formlen); const int y = row*_chary + _chary - _descent + _vofs; - paint_background(j); - - _txt.read_line(j); - - int pos = 0; - - const char* cp; - while((cp = _txt.piece()) != NULL) - { -#if XVT_OS != XVT_OS_SCOUNIX - const int st = _txt.get_style(); - set_font(printer().fontname(), st, _char_size); - - const COLOR bg = trans_color(_txt.get_background()); - const COLOR fg = trans_color(_txt.get_foreground()); - set_color(fg, bg); -#else - set_color(COLOR_BLACK, COLOR_WHITE); -#endif + if (_chary > 1) + { + paint_background(j); - const char* beg = cp; - while (*beg) - { - for (; *beg == ' '; beg++) // Salta spazi iniziali - pos++; + _txt.read_line(j); + + int pos = 0; + + const char* cp; + while((cp = _txt.piece()) != NULL) + { +#if XVT_OS != XVT_OS_SCOUNIX + const int st = _txt.get_style(); + set_font(printer().fontname(), st, _char_size); - if (*beg) - { - int len = 0; - for (const char * end = beg; *end && (*end != ' ' || *(end+1) != ' '); end++) - len++; // Misura sringa da stampare - xvt_dwin_draw_text(win(), _hofs + LEN_SPACES(win(), pos), y, (char*)beg, len); - pos += len; - beg = end; - } - } + const COLOR bg = trans_color(_txt.get_background()); + const COLOR fg = trans_color(_txt.get_foreground()); + set_color(fg, bg); +#else + set_color(COLOR_BLACK, COLOR_WHITE); +#endif + + const char* beg = cp; + while (*beg) + { + for (; *beg == ' '; beg++) // Salta spazi iniziali + pos++; + + if (*beg) + { + int len = 0; + for (const char * end = beg; *end && (*end != ' ' || *(end+1) != ' '); end++) + len++; // Misura sringa da stampare + xvt_dwin_draw_text(win(), _hofs + LEN_SPACES(win(), pos), y, (char*)beg, len); + pos += len; + beg = end; + } + } + } + } else + { + set_font(printer().fontname(), XVT_FS_NONE, _char_size); + xvt_dwin_draw_text(win(), 0, y, (char*)_txt.line(j), -1); } }