Click here to Skip to main content
15,922,894 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CRecordset input parameters Pin
David Crow2-Oct-03 3:06
David Crow2-Oct-03 3:06 
GeneralRe: CRecordset input parameters Pin
pocovnicu2-Oct-03 3:17
pocovnicu2-Oct-03 3:17 
GeneralRe: CRecordset input parameters Pin
David Crow2-Oct-03 3:33
David Crow2-Oct-03 3:33 
Questionhow to set the height of a truetype font ? Pin
JP GOBLET1-Oct-03 23:19
JP GOBLET1-Oct-03 23:19 
AnswerRe: how to set the height of a truetype font ? Pin
Mike Dimmick2-Oct-03 4:25
Mike Dimmick2-Oct-03 4:25 
GeneralRe: how to set the height of a truetype font ? Pin
JP GOBLET2-Oct-03 4:48
JP GOBLET2-Oct-03 4:48 
AnswerRe: how to set the height of a truetype font ? Pin
G. Steudtel2-Oct-03 5:02
G. Steudtel2-Oct-03 5:02 
GeneralRe: how to set the height of a truetype font ? Pin
JP GOBLET2-Oct-03 5:51
JP GOBLET2-Oct-03 5:51 
yes indeed I use a negative lfHeight, it means that height is the character height (ascent + descent, including an internal leading); a positive lfHeight would mean the cell height (= character height + external leading).

G. Steudtel wrote:
HcarFromFont = Metrics.tmAscent should do what you need

so I presume I write :

lf.lfHeight = -HcarWanted; // first try : HcarWanted = 10 mm (in pixels)
font.CreateFontIndirect(&lf);
pDC->SelectObject(&font);
pDC->GetTextMetrics(&Metrics);
HcarFromFont = Metrics.tmAscent;
lf.lfHeight = -HcarFromFont;
font.CreateFontIndirect(&lf);

But don't forget that CreateFontIndirect(&lf) will consider lf.lfHeight as the total character height, how can it known it's meant to be the ascent height ?
Or is there something i didn't grasp ?

Nevertheless I did test the above code : it does not work : the font is now much too small; suppose the initial height was 10 mm : say 6 mm for ascent and 4 mm for descent; so with the 2nd assignment of lfHeight, i will ask a font whose total height is 4 mm.
GeneralRe: how to set the height of a truetype font ? Pin
G. Steudtel2-Oct-03 6:06
G. Steudtel2-Oct-03 6:06 
GeneralRe: how to set the height of a truetype font ? Pin
JP GOBLET4-Oct-03 5:34
JP GOBLET4-Oct-03 5:34 
GeneralAccessing document properties from a VC++ application Pin
jopett1-Oct-03 21:15
jopett1-Oct-03 21:15 
GeneralRe: Accessing document properties from a VC++ application Pin
Michael P Butler2-Oct-03 1:32
Michael P Butler2-Oct-03 1:32 
GeneralRe: Accessing document properties from a VC++ application Pin
jopett2-Oct-03 20:57
jopett2-Oct-03 20:57 
GeneralRide Control System Pin
immanis1-Oct-03 20:54
immanis1-Oct-03 20:54 
GeneralRe: Ride Control System Pin
immanis1-Oct-03 22:58
immanis1-Oct-03 22:58 
GeneralRe: Ride Control System Pin
jhwurmbach1-Oct-03 23:44
jhwurmbach1-Oct-03 23:44 
GeneralRe: Ride Control System Pin
David Chamberlain2-Oct-03 3:09
David Chamberlain2-Oct-03 3:09 
GeneralRe: Ride Control System Pin
jhwurmbach2-Oct-03 5:36
jhwurmbach2-Oct-03 5:36 
GeneralRe: Ride Control System Pin
David Chamberlain2-Oct-03 6:31
David Chamberlain2-Oct-03 6:31 
GeneralRe: Ride Control System Pin
immanis2-Oct-03 5:47
immanis2-Oct-03 5:47 
GeneralRe: Ride Control System Pin
David Chamberlain2-Oct-03 6:49
David Chamberlain2-Oct-03 6:49 
GeneralRe: Ride Control System Pin
immanis2-Oct-03 9:07
immanis2-Oct-03 9:07 
GeneralRe: Ride Control System Pin
David Chamberlain2-Oct-03 9:52
David Chamberlain2-Oct-03 9:52 
GeneralRe: Ride Control System Pin
immanis2-Oct-03 12:21
immanis2-Oct-03 12:21 
GeneralRe: Ride Control System Pin
David Chamberlain3-Oct-03 3:10
David Chamberlain3-Oct-03 3:10 

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.