Gestione dei font di stampa

git-svn-id: svn://10.65.10.50/trunk@1355 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-05-10 15:40:06 +00:00
parent b9459a8656
commit 7abff04a85
5 changed files with 835 additions and 763 deletions

View File

@ -12,6 +12,7 @@ BEGIN
MESSAGE ENABLE,MSK_1_CODES
MESSAGE ENABLE,MSK_1_SIZE
MESSAGE ENABLE,MSK_1_LINES
MESSAGE ENABLE,MSK_1_FONT
MESSAGE ENABLE,DLG_SETPRINT
ITEM "2|Visualizzazione"
MESSAGE HIDE,MSK_1_FILENAME
@ -19,6 +20,7 @@ BEGIN
MESSAGE DISABLE,MSK_1_CODES
MESSAGE DISABLE,MSK_1_SIZE
MESSAGE DISABLE,MSK_1_LINES
MESSAGE DISABLE,MSK_1_FONT
MESSAGE DISABLE,DLG_SETPRINT
ITEM "1|File su disco"
MESSAGE SHOW,MSK_1_FILENAME
@ -26,6 +28,7 @@ BEGIN
MESSAGE ENABLE,MSK_1_CODES
MESSAGE DISABLE,MSK_1_SIZE
MESSAGE DISABLE,MSK_1_LINES
MESSAGE DISABLE,MSK_1_FONT
MESSAGE DISABLE,DLG_SETPRINT
FLAGS "Z"
END
@ -35,6 +38,7 @@ BEGIN
/* viene riempito a run-time con nomi letti da config */
PROMPT 4 5 "Stampante "
HELP "Selezionare il tipo di stampante desiderata"
FLAGS "G"
END
STRING MSK_1_FILENAME 52
@ -51,17 +55,20 @@ LIST MSK_1_CODES 40
BEGIN
PROMPT 4 6 "Tipo stampa "
HELP "Modalita' nelle quale si desidera la stampa"
FLAGS "H"
END
LIST MSK_1_FONT 2 16
BEGIN
PROMPT 4 6 "Font "
HELP "Font di stampa su video o stampante"
ITEM "Courier|Courier"
END
LIST MSK_1_SIZE 3
BEGIN
PROMPT 31 6 "Carattere "
// ITEM "7|7"
ITEM "8|8"
ITEM "10|10"
ITEM "12|12"
ITEM "15|15"
ITEM "17|17"
HELP "Dimensioni del carattere di stampa"
END
@ -78,15 +85,7 @@ BEGIN
HELP "Numero di linee per pollice"
END
LIST MSK_1_FONT 10
BEGIN
PROMPT 4 6 "Font "
HELP "Font di stampa su video o stampante"
ITEM "1|Courier"
FLAGS "D"
END
NUMBER MSK_1_NPAGES 3 0
NUMBER MSK_1_NPAGES 3
BEGIN
PROMPT 54 8 "N.o copie "
HELP "Numero di copie da fare"

File diff suppressed because it is too large Load Diff

View File

@ -382,8 +382,8 @@ bool PrinterDef::read (const char *name, FILE * fd)
else if (l == "Code")
{
TToken_string code (r);
_names.add (TString (code.get ()));
_codes.add (TString (code.get ()));
_names.add ( code.get() );
_codes.add ( code.get() );
}
else if (l == "Form feed")
{
@ -509,9 +509,13 @@ TPrintrow & TPrintrow::put(const char *str, int position, int len)
{
if (len < 1)
len = strlen (str);
bool jumped = TRUE;
if (position < 0)
{
position = _lastpos;
jumped = FALSE;
}
char bg = 'w', fg = 'n';
for (int i = 0; i < len; i++)
@ -556,13 +560,13 @@ TPrintrow & TPrintrow::put(const char *str, int position, int len)
}
break;
case 'B':
_currentstyle = boldstyle;
_currentstyle |= boldstyle;
break;
case 'I':
_currentstyle = italicstyle;
_currentstyle |= italicstyle;
break;
case 'U':
_currentstyle = underlinedstyle;
_currentstyle |= underlinedstyle;
break;
case 'R':
_currentstyle = normalstyle;
@ -626,11 +630,11 @@ TPrintrow & TPrintrow::put(const char *str, int position, int len)
////////// TPRINTER //////////
bool printers_on_key (TMask_field & f, KEY key)
HIDDEN bool printer_handler (TMask_field & f, KEY key)
{
if (key == K_SPACE)
{
TToken_string pn1 (10), pn2 (20);
TToken_string pn1(10), pn2(80);
const PrinterDef & def = printer().get_description(atoi(f.get ()));
const char *s;
@ -699,23 +703,75 @@ void TPrinter::set_win_formlen(WINDOW prwin)
// Handler della maschera di setup
HIDDEN bool set_windows_print_device (TMask_field& f, KEY key)
{
if (key == K_SPACE && f.mask().is_running())
if (key == K_SPACE)
{
TPrinter& pr = printer();
TToken_string& pn = pr.getprinternames ();
TString80 pdev (pn.get(atoi (f.get()))); // Nome stampante corrente
char szDevice[80];
TToken_string & pn = pr.getprinternames ();
TString pdev (pn.get (atoi (f.get())));
GetProfileString ("devices", pdev, "", szDevice, sizeof (szDevice));
pdev << "," << szDevice;
// scrivi (e semmai lo si risistema poi)
WriteProfileString("windows", "device", pdev);
pr.set_printrcd();
pr.set_win_formlen();
const int MAX_FAMILIES = 128;
char* family[MAX_FAMILIES];
const int num_families = (int)xvt_fmap_get_families(pr.get_printrcd(), family, MAX_FAMILIES);
TToken_string pn1(256), pn2(256);
for (int i = 0; i < num_families; i++)
{
pn1.add(family[i]);
pn2.add(family[i]);
}
TMask& m = f.mask();
TList_field& lst = (TList_field&)m.field(MSK_1_FONT);
lst.replace_items(pn1, pn2);
lst.set(printer().fontname());
}
return TRUE;
}
HIDDEN bool font_handler(TMask_field& f, KEY key)
{
if (key == K_SPACE)
{
const char* family = f.get();
const int MAXSIZES = 32;
long sizes[MAXSIZES];
BOOLEAN scalable;
const int num_sizes = (int)xvt_fmap_get_family_sizes(printer().get_printrcd(),
(char*)family, sizes, &scalable, MAXSIZES);
TToken_string pn1(80), pn2(80);
if (scalable)
for (int i = 4; i <= 32; i++)
{
pn1.add(i);
pn2.add(i);
}
else
for (int i = 0; i < num_sizes; i++)
{
pn1.add(sizes[i]);
pn2.add(sizes[i]);
}
TList_field& lst = (TList_field&)f.mask().field(MSK_1_SIZE);
const TString16 old(lst.get());
lst.replace_items(pn1, pn2);
lst.set(old);
}
return TRUE;
}
#endif
TPrinter::TPrinter()
@ -729,7 +785,6 @@ TPrinter::TPrinter()
{
_footerhandler = _headerhandler = NULL;
_linkhandler = NULL;
_config = "printer.ini";
_curprn = 0; // first in list if no default is specified
_curcode = 0; // first in list if no default is specified
@ -747,13 +802,9 @@ TPrinter::TPrinter()
_multiple_copies = main_app().class_id() == CLASS_PRINT_APPLICATION;
// read configuration file
read_configuration (_config);
read_configuration ();
#if XVT_OS == XVT_OS_WIN
TConfig cnf (CONFIG_GENERAL, "Print");
_ch_size = cnf.get_int("Size", NULL, -1, 12);
_lines_per_inch = cnf.get_int("Lines", NULL, -1, 6);
// xvt_print_open ();
set_win_formlen ();
@ -766,11 +817,8 @@ TPrinter::TPrinter()
GetProfileString ("devices", pdev, "", szDevice, sizeof(szDevice));
pdev.add(szDevice);
// get printer names
TToken_string pn2(1024);
_get_windows_printer_names(pn2);
const TString80 p1(pdev.get(0));
const TString80 p1(pdev.get(0)); // current printer
TToken_string& pn2 = getprinternames(); // get printer names
_curprn = pn2.get_pos(p1);
CHECKS(_curprn >= 0, "Can't find printer ", (const char*)p1);
@ -782,18 +830,20 @@ TPrinter::TPrinter()
TToken_string& TPrinter::getprinternames ()
{
// per ora va solo in windows
#if XVT_OS == XVT_OS_WIN
_get_windows_printer_names (_printer_names);
#if XVT_OS == XVT_OS_WIN
if (_printer_names.empty())
_get_windows_printer_names(_printer_names);
#endif
return _printer_names;
}
void TPrinter::read_configuration(const char *conf)
void TPrinter::read_configuration()
{
FILE *cnfp = fopen (conf, "r");
#if XVT_OS == XVT_OS_SCOUNIX
const char* const config = "printer.ini";
FILE *cnfp = fopen (config, "r");
if (cnfp == NULL)
fatal_box ("Impossibile aprire il file %s", (const char *) _config);
fatal_box ("Impossibile aprire il file %s", config);
for (int i = 0; !feof (cnfp); i++)
{
@ -822,53 +872,60 @@ void TPrinter::read_configuration(const char *conf)
}
fclose (cnfp);
TFilename s ("printer.def");
#if XVT_OS == XVT_OS_SCOUNIX
s << '.' << getuid ();
#endif
if (fexist (s))
TConfig prini(CONFIG_USER, "Printer");
const int what = prini.get_int("Type", NULL, -1, 0); // Tipo stampante
_curprn = prini.get_int("Number", NULL, -1, 0); // Numero stampante corrente
_printerfile = prini.get("File", NULL, -1, ""); // File di stampa
_curcode = prini.get_int("Codes", NULL, -1, 0); // Codici di stampa
_fontname = prini.get("Font", NULL, -1, XVT_FFN_FIXED); // Nome del font
_ch_size = prini.get_int("Size", NULL, -1, 12); // Dimensione del font
_lines_per_inch = prini.get_int("Lines", NULL, -1, 6); // Linee per pollice
_isgraphics = prini.get_bool("Graphic", NULL, -1, FALSE); // Grafica attiva
if (_printerfile.empty())
{
TScanner sc (s);
TToken_string t (sc.line ());
int where_print = t.get_int (1);
t = sc.line ();
_curprn = t.get_int(1);
t = sc.line ();
_printerfile = t.get (1);
t = sc.line ();
_curcode = t.get_int (1);
#if XVT_OS != XVT_OS_WIN
PrinterDef & def = (PrinterDef &) get_description (_curprn);
#endif
switch (where_print)
{
case 0: // stampante
#if XVT_OS == XVT_OS_WIN
_printertype = winprinter;
_printerfile.tempdir();
#if XVT_OS == XVT_OS_SCOUNIX
_printerfile << '/';
#else
switch (atoi (def._printertype))
{
case 0:
_printertype = normprinter;
break;
case 1:
_printertype = localprinter;
break;
case 2:
_printertype = spoolprinter;
break;
}
#endif
_printerfile << '\\';
#endif
}
switch (what)
{
case 0:
#if XVT_OS == XVT_OS_WIN
_printertype = winprinter;
#else
PrinterDef & def = (PrinterDef &) get_description (_curprn);
switch (atoi (def._printertype))
{
case 1:
_printertype = localprinter;
break;
case 1: // file
_printertype = fileprinter;
case 2:
_printertype = spoolprinter;
break;
case 2: // video
_printertype = screenvis;
_curcode = 0;
default:
_printertype = normprinter;
break;
}
}
#endif
break;
case 1: // file
_printertype = fileprinter;
break;
case 2: // video
_printertype = screenvis;
_curcode = 0;
break;
default:
break;
}
}
TPrinter::~TPrinter ()
@ -1236,29 +1293,15 @@ _currentpage = 1;
return _isopen = TRUE;
}
void TPrinter::set()
{
main_app().disable_menu_item (M_FILE_PG_SETUP);
TMask mask ("bagn001a");
TToken_string pn1 (50), pn2 (100);
int i;
if (_printerfile.empty())
{
_printerfile.tempdir();
#if XVT_OS == XVT_OS_SCOUNIX
_printerfile << '/';
#else
_printerfile << '\\';
#endif
}
TMask mask("bagn001a");
TFilename defile("printer.def");
#if XVT_OS == XVT_OS_SCOUNIX
defile << format (".%d", getuid ());
#endif
mask.set_workfile(defile);
TToken_string pn1(50), pn2(100);
int i;
mask.set(MSK_1_FILENAME, _printerfile);
mask.set(MSK_1_NPAGES, _ncopies);
@ -1278,9 +1321,7 @@ void TPrinter::set()
if (!_multiple_copies)
mask.hide(MSK_1_NPAGES);
pn1 = "";
pn2 = "";
pn1 = pn2 = "";
for (i = 0; i < ((PrinterDef &)_printers[_curprn])._names.items(); i++)
{
pn1.add(i);
@ -1288,9 +1329,8 @@ void TPrinter::set()
}
((TList_field &)(mask.field (MSK_1_CODES))).replace_items(pn1, pn2);
#if XVT_OS == XVT_OS_WIN
mask.xvt_win_set_handler (MSK_1_PRINTERS, printers_on_key);
#endif
mask.xvt_win_set_handler (MSK_1_PRINTERS, printer_handler);
if (_printertype == fileprinter)
mask.set (MSK_1_TYPE, "1");
else if (_printertype == screenvis)
@ -1299,7 +1339,10 @@ void TPrinter::set()
mask.set (MSK_1_TYPE, "0");
mask.set(MSK_1_PRINTERS, _curprn);
mask.show(MSK_1_CODES);
mask.set(MSK_1_CODES, _curcode);
KEY k;
if ((k = mask.run()) == K_ESC)
@ -1346,23 +1389,27 @@ void TPrinter::set()
}
#else
_get_windows_printer_names(pn2);
mask.set_handler (MSK_1_PRINTERS, set_windows_print_device);
mask.set_handler (MSK_1_FONT, font_handler);
pn2 = getprinternames();
char old_default[80];
GetProfileString ("windows", "device", ",,,", old_default, sizeof(old_default));
for (i = 0; i < pn2.items (); i++)
pn1.add(i);
((TList_field &) (mask.field (MSK_1_PRINTERS))).replace_items(pn1, pn2);
mask.set(MSK_1_PRINTERS, pn1.get(_curprn));
TList_field& plst = (TList_field&)mask.field (MSK_1_PRINTERS);
plst.replace_items(pn1, pn2);
plst.set(pn1.get(_curprn));
mask.hide(MSK_1_CODES);
if (!_multiple_copies) mask.hide(MSK_1_NPAGES);
mask.set(MSK_1_ISGRAPHICS, _isgraphics ? "X" : "");
mask.set(MSK_1_FONT, _fontname);
mask.set(MSK_1_SIZE, _ch_size);
mask.set(MSK_1_LINES, _lines_per_inch);
mask.set(MSK_1_ISGRAPHICS, _isgraphics ? "X" : "");
if (!_multiple_copies)
mask.hide(MSK_1_NPAGES);
if (_printertype == fileprinter)
mask.set (MSK_1_TYPE, "1");
@ -1371,8 +1418,6 @@ void TPrinter::set()
else
mask.set (MSK_1_TYPE, "0");
mask.set_handler (MSK_1_PRINTERS, set_windows_print_device);
KEY k;
int oldprn = _curprn;
@ -1399,22 +1444,12 @@ void TPrinter::set()
}
}
_curprn = atoi(mask.get(MSK_1_PRINTERS));
if (k == K_INS)
{
// tutto resta com'e'
mask.save ();
TConfig cnf (CONFIG_GENERAL, "Print");
cnf.set("Size", mask.get(MSK_1_SIZE), "12");
cnf.set("Lines", mask.get(MSK_1_LINES), "6");
}
if (k == K_ESC || k == K_ENTER)
{
// riaggiusta stampante default windows come prima
// curprn e rcd sono quelle di prima
main_app().enable_menu_item(M_FILE_PG_SETUP);
WriteProfileString("windows","device", old_default);
WriteProfileString("windows", "device", old_default);
}
if (k == K_ESC)
{
@ -1424,6 +1459,7 @@ void TPrinter::set()
return;
}
_curprn = atoi(mask.get(MSK_1_PRINTERS));
_ncopies = atoi (mask.get (MSK_1_NPAGES));
switch (atoi (mask.get (MSK_1_TYPE)))
@ -1442,10 +1478,27 @@ void TPrinter::set()
break;
}
_isgraphics = mask.get_bool (MSK_1_ISGRAPHICS);
_ch_size = mask.get_int (MSK_1_SIZE);
_fontname = mask.get(MSK_1_FONT);
const int cs = mask.get_int(MSK_1_SIZE);
if (cs > 4) _ch_size = cs;
_lines_per_inch = mask.get_int (MSK_1_LINES);
_isgraphics = mask.get_bool (MSK_1_ISGRAPHICS);
set_win_formlen ();
if (k == K_INS)
{
TConfig prini(CONFIG_USER, "Printer");
prini.set("Type", _printertype); // Tipo stampante
prini.set("Number", _curprn); // Numero stampante corrente
prini.set("File", _printerfile); // File di stampa
prini.set("Codes", _curcode); // Codici di stampa
prini.set("Font", _fontname); // Nome del font
prini.set("Size", _ch_size); // Dimensione del font
prini.set("Lines", _lines_per_inch); // Linee per pollice
prini.set("Graphic", _isgraphics ? "X" : ""); // Grafica attiva
}
#endif

View File

@ -15,12 +15,14 @@
// @DPUB
enum TPrintstyle {
enum TPrintstyle
{
normalstyle = 0,
boldstyle = 1,
underlinedstyle = 2,
italicstyle = 3
};
italicstyle = 4,
jumpstyle = 64;
};
enum TPrtype {
normprinter = 0,
@ -83,19 +85,17 @@ class PrinterDef : public TObject
TString _filtername; // filter for the pipe (UNIX only)
TString _devicename; // name of print device
char _atstr[4][10]; // attribute codes for the current printer
TArray _codes; // print codes
TArray _names; // name of print codes
TString_array _codes; // print codes
TString_array _names; // name of print codes
TString _ffcode; // formfeed code for the current printer
TString _nlcode; // special newline code for the current printer
public:
bool read(const char* name, FILE* fd); // read description from file;
bool isdefault(); // name matches "Default"
const char* get_codenames(word i) const { return i < (word) _names.items() ? (const char*)(TString&)_names[i] : NULL; }
const char* get_codes(word i) const { return i < (word) _codes.items() ? (const char*)(TString&)_codes[i] : NULL; }
PrinterDef() : _printername(10), _filtername(10),
_ffcode("\f"), _nlcode("\n")
{}
const char* get_codenames(word i) const { return i < (word)_names.items() ? (const char*)_names.row(i) : NULL; }
const char* get_codes(word i) const { return i < (word)_codes.items() ? (const char*)_codes.row(i) : NULL; }
PrinterDef() : _printername(10), _filtername(10), _ffcode("\f"), _nlcode("\n") {}
};
@ -133,7 +133,6 @@ class TPrinter : public TObject
TViswin* _vf; // pointer to file visualizer
TTextfile _txt;
TFilename _config; // name of the configuration file
TFilename _exportfile; // name of export file
int _headersize;
int _footersize;
@ -145,7 +144,10 @@ class TPrinter : public TObject
int _formlen; // length of the logic page
int _formwidth; // size of the logic page
int _currentrow; // next row to print
TString80 _fontname; // Font name
int _ch_size; // Font height
word _currentpage; // logic page containing _currentrow
word _frompage; // first page to print (normally 0)
word _topage; // last page to print (normally = USHRT_MAX)
@ -191,7 +193,7 @@ protected:
virtual char newline() { return '\n'; }
bool printrow (TPrintrow* rowtoprint=NULL); // base methods for printing
bool printformfeed ();
void read_configuration(const char* cfg);
void read_configuration();
bool printheader();
bool printfooter();
@ -206,7 +208,6 @@ public:
static BOOLEAN XVT_CALLCONV1 start_winprint(long);
#endif
void set_config_file (const char * ffile) { _config = ffile ; }
void set_from_page (word from) { _frompage = from; }
void set_to_page (word to) { _topage = to; }
void set_hwff (bool hwff) { _hwformfeed = hwff; }
@ -304,7 +305,9 @@ public:
int get_horz_offset() const { return _horz_offset; }
int get_dots_per_line() const { return _dots_per_line; }
bool isgraphics() const { return _isgraphics; }
int get_char_size() const { return _ch_size; }
char* fontname() const { return (char*)(const char*)_fontname; }
// bookmarks
int set_bookmark(const char* txt, int father = -1);

View File

@ -6,17 +6,27 @@
HIDDEN int LEN_SPACES(WINDOW win, int x)
{
HIDDEN long w = 0L;
if (x < 0)
{
x = 80;
w = 0L;
}
if (w == 0L)
{
TString256 spc; spc.spaces(256);
w = xvt_dwin_get_text_width(win,(char*)(const char*)spc,256);
TString256 spc; spc.fill('M', 132);
w = xvt_dwin_get_text_width(win,(char*)(const char*)spc, 132);
}
const int k = int((w*x) >> 8);
const int k = int((w*x) / 132);
#ifdef DBG
TString256 spc; spc.spaces(x);
const int k1 = xvt_dwin_get_text_width(win,(char*)(const char*)spc,x);
CHECK(k == k1, "Maguire disagrees");
static bool error_on = TRUE;
if (error_on)
{
TString256 spc; spc.fill('M', x);
const int k1 = xvt_dwin_get_text_width(win,(char*)(const char*)spc,x);
if (k != k1)
error_on = error_box("Maguire disagrees: %d != %d", k, k1);
}
#endif
return k;
@ -148,34 +158,43 @@ void TPrintwin::paint_background(long j)
void TPrintwin::paint_row(long j)
{
char line[257];
const char* cp; int pos = 0;
int pixpos = 0;
int row = (int)(j % _formlen);
const int row = (int)(j % _formlen);
const int y = row*_chary + _chary - _descent + _vofs;
paint_background(j);
strcpy(line,_txt.line(j));
_txt.read_line(j);
while(cp = _txt.piece())
int pos = 0;
const char* cp;
while((cp = _txt.piece()) != NULL)
{
pos += strlen(cp);
#if XVT_OS != XVT_OS_SCOUNIX
int st = _txt.get_style();
long bg = trans_color(_txt.get_background());
long fg = trans_color(_txt.get_foreground());
set_font(XVT_FFN_FIXED, st, _char_size);
set_font(printer().fontname(), st, _char_size);
set_color(fg,bg);
#else
set_color(COLOR_BLACK, COLOR_WHITE);
#endif
xvt_dwin_draw_text(win(),
pixpos + _hofs,
row*_chary + _chary - _descent + _vofs,
(char *)cp, -1);
pixpos = xvt_dwin_get_text_width(win(), line, pos);
const char* end = NULL;
for (const char* begin = cp; *begin; begin = end)
{
for (; *begin == ' '; begin++)
pos++;
int len = 0;
for (end = begin; *end > ' ' || (*end && *(end+1) > ' '); end++)
len++;
if (*begin > ' ')
xvt_dwin_draw_text(win(), _hofs + LEN_SPACES(win(), pos), y, (char*)begin, len);
pos += len;
}
}
}
@ -212,7 +231,7 @@ bool TPrintwin::do_print()
&& (rct = xvt_print_get_next_band()) != NULL)
{
set_font(XVT_FFN_SYSTEM, XVT_FS_NONE, _char_size);
set_font(XVT_FFN_FIXED, XVT_FS_NONE, _char_size);
set_font(printer().fontname(), XVT_FS_NONE, _char_size);
#ifdef DBG
long size1 = xvt_dwin_get_font_size_mapped(win());
CHECK(size == size1, "Failed to set font. xvt bugs???");
@ -235,33 +254,31 @@ TPrintwin::TPrintwin(TTextfile& txt)
_printrcd = p.get_printrcd();
WINDOW prwin = xvt_print_create_win(_printrcd, (char*)(const char*)main_app().title());
if (prwin == NULL_WIN)
{
_aborted = TRUE;
return;
}
set_win(prwin);
#endif
_char_size = p.get_char_size();
set_font(XVT_FFN_FIXED, XVT_FS_NONE, _char_size);
set_font(p.fontname(), XVT_FS_NONE, _char_size);
LEN_SPACES(win(), -1); // force update
#if XVT_OS != XVT_OS_SCOUNIX
p.set_win_formlen(prwin); // Calcola offset e altre misure pagina
#endif
_inited = TRUE;
xvt_dwin_get_font_metrics(prwin, &_lead, &_ascent, &_descent);
_bg = &p.getbgdesc();
_chary = p.get_dots_per_line();
_hofs = p.get_horz_offset();
_vofs = p.get_vert_offset();
#endif
_formlen = p.formlen();
_formwidth = p.formwidth();
#if XVT_OS != XVT_OS_SCOUNIX
if (prwin != NULL_WIN)
{
xvt_dwin_get_font_metrics(prwin, &_lead, &_ascent, &_descent);
_bg = &p.getbgdesc();
_chary = p.get_dots_per_line();
_hofs = p.get_horz_offset();
_vofs = p.get_vert_offset();
}
else _aborted = TRUE;
#endif
LEN_SPACES(win(), 50); //debug
_inited = TRUE;
}