Negative Dialog Font Height 
Author Message
 Negative Dialog Font Height

I'm trying to get the height of the dialog font.  I can't understand why the
height is negative and the width is 0.
What's that suppose to mean?

BOOL CMyDialog::OnInitDialog()
{
     LOGFONT lf;
     CFont* pFont = GetFont();
     pFont->GetLogFont(&lf);

     int nHeight = lf.lfHeight;   // nHeight is negative?
     int nWidth = lf.lfWidth;   // nHeight is zero?

Quote:
}

Thanks in advance!
Wendy


Mon, 04 Dec 2000 03:00:00 GMT  
 Negative Dialog Font Height

Quote:

> I'm trying to get the height of the dialog font.  I can't understand why the
> height is negative and the width is 0.
> What's that suppose to mean?

if the height is negative,  the absolute value is the ascent height. a positive
value gives the total height. width is usually set to 0. if the height is fixed,
the width varies depending on the proportions of the font, unless you are using
on of the fixed width fonts.

btw, ascent height is the character height and the internal leading, but doesn't
include the descent height of the tails on p for instance.



Mon, 04 Dec 2000 03:00:00 GMT  
 Negative Dialog Font Height

Where can I get the documentation for this?  The logfont doc doesn't tell me
that.

I need to construct a checkbox on the fly.  I also need to line up the
bottom of the checkbox with the bottom of a listbox.  Given the bottom of
the listbox, I can get the top of the checkbox by ...

  nCheckBoxTop  = nListBoxBottom - nFontHeight;

The questions remain as ...

1) What is the minimum checkbox height without clipping? Does that equal to
the mininum font height?
2) Is the following correct ...
    nFontHeight = tmExternalLeading + tmHeight
    nFontHeight = tmExternalLeading + ascentHeight + descentHeight
3) Now that I have aescent height, how do I get the descend height and the
external leading so that I can compute the total font height?

Quote:


>> I'm trying to get the height of the dialog font.  I can't understand why
the
>> height is negative and the width is 0.
>> What's that suppose to mean?

>if the height is negative,  the absolute value is the ascent height. a
positive
>value gives the total height. width is usually set to 0. if the height is
fixed,
>the width varies depending on the proportions of the font, unless you are
using
>on of the fixed width fonts.

>btw, ascent height is the character height and the internal leading, but
doesn't
>include the descent height of the tails on p for instance.



Tue, 05 Dec 2000 03:00:00 GMT  
 Negative Dialog Font Height

Quote:

>Where can I get the documentation for this?  The logfont doc doesn't tell me
>that.

The following is from the online documentation of logfont.

...
lfHeight

Specifies the height, in logical units, of the fonts character cell
or character. The character height value (also known as the em height)
is the character cell height value minus the internal-leading value.
The font mapper interprets the value specified in lfHeight in the
following manner:

Value   Meaning

 > 0         The font mapper transforms this value into device units and
matches it against the cell height of the available fonts.

 0      The font mapper uses a default height value when it searches
for a match.

 < 0         The font mapper transforms this value into device units and
matches its absolute value against the character height of the
available fonts.

Quote:

>I need to construct a checkbox on the fly.  I also need to line up the
>bottom of the checkbox with the bottom of a listbox.  Given the bottom of
>the listbox, I can get the top of the checkbox by ...

>  nCheckBoxTop  = nListBoxBottom - nFontHeight;

>The questions remain as ...

>1) What is the minimum checkbox height without clipping? Does that equal to
>the mininum font height?
>2) Is the following correct ...
>    nFontHeight = tmExternalLeading + tmHeight
>    nFontHeight = tmExternalLeading + ascentHeight + descentHeight
>3) Now that I have aescent height, how do I get the descend height and the
>external leading so that I can compute the total font height?



>>> I'm trying to get the height of the dialog font.  I can't understand why
>the
>>> height is negative and the width is 0.
>>> What's that suppose to mean?

>>if the height is negative,  the absolute value is the ascent height. a
>positive
>>value gives the total height. width is usually set to 0. if the height is
>fixed,
>>the width varies depending on the proportions of the font, unless you are
>using
>>on of the fixed width fonts.

>>btw, ascent height is the character height and the internal leading, but
>doesn't
>>include the descent height of the tails on p for instance.

Don Grasberger
(remove --- from address to e-mail)


Fri, 08 Dec 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Negative Dialog Font Height

2. Negative Dialog Font Height

3. Negative Dialog Font Height

4. Negative Dialog Font Height

5. How can I change the font height?

6. About font height

7. changing font height causes cedit to scroll

8. Is (font height) differs from ought

9. Size OLE/ActiveX/ATL control to height of font

10. Calculating Font Height for printing

11. How to determine font height

12. Fonts and CListCtrl - how to set line height?

 

 
Powered by phpBB® Forum Software