Patch level : 2.2

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :
Migliorato calcolo font di stampa


git-svn-id: svn://10.65.10.50/trunk@13499 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2005-11-17 14:28:53 +00:00
parent d871c027a8
commit 58a4e125cb

View File

@ -2202,36 +2202,29 @@ wxFont& TFontId::Font(wxDC* dc, WINDOW win) const
if (nBest == 0)
nBest = nMax;
/*
#ifdef WIN32
// Pezza per cercare di ovviare a dimensioni assurde calcolate dai sistemi NON XP
int major, minor;
const int nVer = ::wxGetOsVersion(&major, &minor);
if (nVer != wxWINDOWS_NT)
// Pezza per cercare di ovviare a dimensioni assurde calcolate dai sistemi Win *
// Praticamente succede che il Courier 70 sia piu' piccolo del Curier 60
// Per cui una volta candidata una dimensione (nBest) tramite le righe precedenti
// cerco il primo font piu' piccolo che non sfonda
bool bPrevGood = true;
for (int i = 15; i > 0; i--)
{
bool bPrevGood = true;
for (int i = 15; i > 0; i--)
const int nFontSize = nBest-i;
wxFont courier(nFontSize, wxFIXED, wxNORMAL, wxNORMAL, FALSE, DEFAULT_FONT_NAME);
dc->SetFont(courier);
int tw, th; dc->GetTextExtent(str, &tw, &th);
if (tw > nTarget10 && bPrevGood)
{
const int nFontSize = nBest-i;
wxFont courier(-nFontSize, Family(), wxNORMAL, wxNORMAL, FALSE, DEFAULT_FONT_NAME);
dc->SetFont(courier);
int tw; dc->GetTextExtent(str, &tw, NULL);
if (tw > nTarget10 && bPrevGood)
{
nBest = nFontSize-1;
break;
}
bPrevGood = tw <= nTarget10;
nBest = nFontSize-1;
break;
}
bPrevGood = tw <= nTarget10;
}
#endif
*/
dPrintScale = double(nBest) / double(nSize);
#ifdef LINUX
dPrintScale /= 10.0; // * wxPostScriptDC::GetResolution()) / 72.0);
#endif
lastDC = dc;
}