tomschoem
June 3rd, 1999, 09:58 AM
I use CFont::CreateFont or CFont::CreatePointFont to create my objects. My problem is happening only while printing or print previewing : all my strings appear condensed (and in debug mode I get an assertion fault).
Any idea anyone?
Christophe
April 28th, 2000, 10:31 AM
use this code to change you font
CFont police;
TEXTMETRIC tm;
police.DeleteObject ();
long ht = MulDiv(Size, pDC->GetDeviceCaps (VERTSIZE), 72);
police.CreateFont ( ht , 0, 0, 0, int(ParamText->font.Weight), int(ParamText->font.Italic),
int (ParamText->font.Underlined), 0,
ANSI_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH | FF_MODERN, ParamText->font.Name);
pDC->SelectObject (police);
pDC->GetTextMetrics(&tm);
police.DeleteObject ();
Size it the size like word or excel (10, 12, 16...) and you can retreive the format of font by structure TEXTMETRIC
chrisstophe