Patch level : 2.2

Files correlati     : xvaga
Ricompilazione Demo : [ ]
Commento            :
Ora i report (ed anche i form) si accorgono di un eventuale cambiamento della stampante o della sua risoluzione e ricalcolano correttamente il font di stampa


git-svn-id: svn://10.65.10.50/trunk@13664 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2006-01-05 13:46:00 +00:00
parent a37012d240
commit ac5d36ee3b

View File

@ -2164,18 +2164,16 @@ wxFont& TFontId::Font(wxDC* dc, WINDOW win) const
if (win == PRINTER_WIN)
{
static wxDC* lastDC = NULL;
static wxSize lastPPI;
static double dPrintScale = 1.0;
if (dc != lastDC)
const wxSize ppi = dc->GetPPI();
if (dc != lastDC || ppi != lastPPI)
{
#ifdef WIN32
const char* DEFAULT_FONT_NAME = "Courier New";
const char* const DEFAULT_FONT_NAME = "Courier New";
#else
const char* DEFAULT_FONT_NAME = "Courier";
const char* const DEFAULT_FONT_NAME = "Courier";
#endif
const wxSize ppi = dc->GetPPI();
const int nTarget10 = 10 * ppi.x; // pixel in 10 pollici in larghezza
const int cpi10 = 10 * 120 / nSize; // caratteri stimati in 10 pollici
const wxString str('M', cpi10); // stringa campione per stimare la larghezza
@ -2227,6 +2225,7 @@ wxFont& TFontId::Font(wxDC* dc, WINDOW win) const
dPrintScale /= 10.0; // * wxPostScriptDC::GetResolution()) / 72.0);
#endif
lastDC = dc;
lastPPI = ppi;
}
nSize = (int)(nSize * dPrintScale + 0.5);
}