calcolo dimensione font per stampa fogli libri bollati

git-svn-id: svn://10.65.10.50/trunk@4173 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 1997-03-03 15:21:16 +00:00
parent 5861624bfc
commit 096c06329a

View File

@ -2204,9 +2204,8 @@ BOOLEAN XVT_CALLCONV1 calc_font_callback(long data)
// Create pint window // Create pint window
WINDOW win = xvt_print_create_win(printer().get_printrcd(), "Calcolo font"); WINDOW win = xvt_print_create_win(printer().get_printrcd(), "Calcolo font");
// Set print font if (win != NULL_WIN)
xvt_set_font(win, fd._name, XVT_FS_NONE, fd._size); {
long pw, ph, phr, pvr; // Printer width, height, horizontal and vertical resolution long pw, ph, phr, pvr; // Printer width, height, horizontal and vertical resolution
xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, printer().get_printrcd(), &ph, &pw, &pvr, &phr); xvt_app_escape (XVT_ESC_GET_PRINTER_INFO, printer().get_printrcd(), &ph, &pw, &pvr, &phr);
@ -2214,15 +2213,21 @@ BOOLEAN XVT_CALLCONV1 calc_font_callback(long data)
test.fill('M', fd._columns); test.fill('M', fd._columns);
for (int size = fd._size; size > 0; size--) for (int size = fd._size; size > 0; size--)
{ {
// Set print font
xvt_set_font(win, fd._name, XVT_FS_NONE, size);
const int w = xvt_dwin_get_text_width(win, (char*)(const char*)test, fd._columns); const int w = xvt_dwin_get_text_width(win, (char*)(const char*)test, fd._columns);
if (w <= phr) if (w <= ph)
break; break;
} }
xvt_vobj_destroy(win);
if (size > 0) if (size > 0)
fd._size = size; fd._size = size;
return FALSE; xvt_vobj_destroy(win);
}
return win != NULL_WIN;
} }
int TPrinter::calc_font_size(int columns) const int TPrinter::calc_font_size(int columns) const