书上说  系统字体的尺寸 和 像数大小  有关 那如何求得像数大小???

解决方案 »

  1.   

    注意看MSDN!LOGFONT
    The LOGFONT structure defines the attributes of a font. typedef struct tagLOGFONT { // lf 
       LONG lfHeight; 
       LONG lfWidth; 
       LONG lfEscapement; 
       LONG lfOrientation; 
       LONG lfWeight; 
       BYTE lfItalic; 
       BYTE lfUnderline; 
       BYTE lfStrikeOut; 
       BYTE lfCharSet; 
       BYTE lfOutPrecision; 
       BYTE lfClipPrecision; 
       BYTE lfQuality; 
       BYTE lfPitchAndFamily; 
       TCHAR lfFaceName[LF_FACESIZE]; 
    } LOGFONT; 
     
    MemberslfHeight 
    Specifies the height, in logical units, of the font's 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. 
    For all height comparisons, the font mapper looks for the largest font that does not exceed the requested size. This mapping occurs when the font is used for the first time. For the MM_TEXT mapping mode, you can use the following formula to specify a height for a font with a given point size: lfHeight = -MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);