Click here to Skip to main content
16,008,183 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to get System Font size? Pin
vgrigor27-Nov-03 2:17
vgrigor27-Nov-03 2:17 
AnswerRe: How to get System Font size? Pin
Roger Allen27-Nov-03 3:19
Roger Allen27-Nov-03 3:19 
AnswerRe: How to get System Font size? Pin
Mike Dimmick27-Nov-03 6:38
Mike Dimmick27-Nov-03 6:38 
GeneralGetting FontWidth from FontSize Pin
Pazzuzu27-Nov-03 1:28
Pazzuzu27-Nov-03 1:28 
GeneralRe: Getting FontWidth from FontSize Pin
BadJerry27-Nov-03 1:49
BadJerry27-Nov-03 1:49 
GeneralRe: Getting FontWidth from FontSize Pin
Anonymous27-Nov-03 3:05
Anonymous27-Nov-03 3:05 
GeneralRe: Getting FontWidth from FontSize Pin
Roger Allen27-Nov-03 3:24
Roger Allen27-Nov-03 3:24 
GeneralRe: Getting FontWidth from FontSize Pin
Pazzuzu27-Jan-04 21:30
Pazzuzu27-Jan-04 21:30 
Hi,



I want to know the width of a font,Before I Create a font. My aim is to provide
a character ratio for the font.
Iam creating the font using the "CreateFont" method.In this Function,the 2nd parameter
is width.So to Create a Font with a particular character ratio,I need to give in this 2nd
parameter a value which is equal to (widthoffont * characterratio).

sO THATS why I want to know the width of the font before creating a font before.Is it
possible?.

I tried as u told:
CFont font:
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
font.CreateFont(-height,0,rotVal.x ,rotVal.y,style,FALSE,FALSE,0,ANSI_CHARSET,
OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH|FF_SWISS,
reinterpret_cast(facename.c_str()));

// In "CreateFont" method Iam giving width as 0 in the 2nd parameter as I dont know the width in advance & I tried to get the width windows allocated using the logFont Structure. But Iam not getting the width windows allocated instead Iam getting '0' which I gave in the "CreateFont" method.How is it possible to get the width windows allocated.

Would be nice if someone tells me how to achieve this....


font.GetLogFont(&lf);
long width = lf.lfWidth;
font.CreateFontIndirect(&lf);

Thanks in advance.........

QuestionHow to boot from usb flash memory drive? Pin
stpg27-Nov-03 1:16
stpg27-Nov-03 1:16 
AnswerRe: How to boot from usb flash memory drive? Pin
Anonymous27-Nov-03 1:38
Anonymous27-Nov-03 1:38 
AnswerRe: How to boot from usb flash memory drive? Pin
jhwurmbach27-Nov-03 2:38
jhwurmbach27-Nov-03 2:38 
Generaladding HTML help to an existing project Pin
si_6927-Nov-03 1:08
si_6927-Nov-03 1:08 
GeneralGetFont() Pin
v0id_dev27-Nov-03 0:57
v0id_dev27-Nov-03 0:57 
GeneralRe: GetFont() Pin
RChin27-Nov-03 1:01
RChin27-Nov-03 1:01 
GeneralRe: GetFont() Pin
Roger Allen27-Nov-03 3:28
Roger Allen27-Nov-03 3:28 
Generalvideo chat Pin
vnws27-Nov-03 0:26
sussvnws27-Nov-03 0:26 
GeneralRe: video chat Pin
Jerry Evans27-Nov-03 3:54
Jerry Evans27-Nov-03 3:54 
GeneralErase external files Pin
chadell26-Nov-03 23:45
chadell26-Nov-03 23:45 
GeneralRe: Erase external files Pin
Cedric Moonen26-Nov-03 23:53
Cedric Moonen26-Nov-03 23:53 
GeneralRe: Erase external files Pin
chadell27-Nov-03 1:59
chadell27-Nov-03 1:59 
GeneralRe: Erase external files Pin
Neville Franks27-Nov-03 0:25
Neville Franks27-Nov-03 0:25 
GeneralRe: Erase external files Pin
Prakash Nadar27-Nov-03 1:01
Prakash Nadar27-Nov-03 1:01 
Generalstore and retrieve .bmp using sql server 2000 and vc++ 6.0 Pin
mctpursuer26-Nov-03 23:09
mctpursuer26-Nov-03 23:09 
GeneralA confusing problem... Pin
Rob Manderson26-Nov-03 23:03
protectorRob Manderson26-Nov-03 23:03 
GeneralRe: A confusing problem... Pin
Ryan Roberts26-Nov-03 23:42
Ryan Roberts26-Nov-03 23:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.