Patch level : 2.0 512

Files correlati     : xvaga.dll
Ricompilazione Demo : [ ]
Commento            : corretto errore AO20064: su Win98 se provo a stampare con una stampante Genrica/Solo Testo non stampa nulla e il programma si blocca, mentre su Win2000 funziona.


git-svn-id: svn://10.65.10.50/trunk@11290 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 2003-06-26 11:02:57 +00:00
parent 71c5eef345
commit 7eb0233e22

View File

@ -1845,6 +1845,7 @@ wxFont& TFontId::Font(wxDC* dc) const
{
const wxSize ppi = dc->GetPPI();
dPrintScale = ppi.x / 96.0; // First guess for scaling factor
int nLastTextWidth = 0;
int nBestSize = 0;
double nMin = dPrintScale-0.1;
@ -1858,9 +1859,19 @@ wxFont& TFontId::Font(wxDC* dc) const
wxFont courier(nFontSize, wxMODERN, wxNORMAL, wxNORMAL);
dc->SetFont(courier);
int tw; dc->GetTextExtent("0123456789", &tw, NULL);
if (tw != nLastTextWidth)
nLastTextWidth = tw; // Happens with Generic/Text Only
else
{
if (nBestSize == 0)
nBestSize = nFontSize;
break;
}
if (tw > ppi.x)
{
nMax = nScale;
}
else
{
nMin = nScale;