Rif. mod. 95/30. Modificata la TPrintwin::paint_row().

Aggiunto un controllo su _chary: nel caso equivalga ad 1 si stampa
la riga nuda e cruda, senza posizionarsi tramite calcoli. Cio' e'
utile per stampanti "Generico/Solo testo". In questo modo la stampa
delle deleghe risulta precisa sia sull'asse delle ascisse  che quello
delle ordinate quando si utilizza un font della stampante.


git-svn-id: svn://10.65.10.50/trunk@1827 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
angelo 1995-09-14 14:25:30 +00:00
parent 63d6803c87
commit 4105a3beed

View File

@ -161,42 +161,49 @@ void TPrintwin::paint_row(long j)
const int row = (int)(j % _formlen); const int row = (int)(j % _formlen);
const int y = row*_chary + _chary - _descent + _vofs; const int y = row*_chary + _chary - _descent + _vofs;
paint_background(j); if (_chary > 1)
{
_txt.read_line(j); paint_background(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
const char* beg = cp; _txt.read_line(j);
while (*beg)
{ int pos = 0;
for (; *beg == ' '; beg++) // Salta spazi iniziali
pos++; 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) const COLOR bg = trans_color(_txt.get_background());
{ const COLOR fg = trans_color(_txt.get_foreground());
int len = 0; set_color(fg, bg);
for (const char * end = beg; *end && (*end != ' ' || *(end+1) != ' '); end++) #else
len++; // Misura sringa da stampare set_color(COLOR_BLACK, COLOR_WHITE);
xvt_dwin_draw_text(win(), _hofs + LEN_SPACES(win(), pos), y, (char*)beg, len); #endif
pos += len;
beg = end; 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);
} }
} }