谁能把TEXTMETRIC结构内的数据成员的用途告诉我,要是有些例子就更好,谢谢!

解决方案 »

  1.   

    这是TEXTMETRIC的定义.
    typedef struct tagTEXTMETRIC
    {
         LONG tmHeight ; 
         LONG tmAscent ; 
         LONG tmDescent ;  
         LONG tmInternalLeading ; 
         LONG tmExternalLeading ; 
         LONG tmAveCharWidth ; 
         LONG tmMaxCharWidth ; 
              [other structure fields]
    }
    TEXTMETRIC, * PTEXTMETRIC ;
      

  2.   

    The most important value is tmHeight, which is the sum of tmAscent and tmDescent. These two values represent the maximum vertical extents of characters in the font above and below the baseline. The term "leading" refers to space that a printer inserts between lines of text. In the TEXTMETRIC structure, internal leading is included in tmAscent (and thus in tmHeight) and is often the space in which accent s appear. The tmInternalLeading field could be set to 0, in which case accented letters are made a little shorter so that the accent s fit within the ascent of the character. The TEXTMETRIC structure also includes a field named tmExternalLeading, which is not included in the tmHeight value. This is an amount of space that the designer of the font suggests be added between successive rows of displayed text. You can accept or reject the font designer's suggestion for including external leading when spacing lines of text. In the system fonts that I've encountered recently, tmExternalLeading has been zero, which is why I didn't include it in Figure 4-3. (Despite my vow not to tell you the dimensions of a system font, Figure 4-3 is accurate for the system font that Windows uses by default for a 640 by 480 display.) The TEXTMETRIC structure contains two fields that describe character widths: the tmAveCharWidth field is a weighted average of lowercase characters, and tmMaxCharWidth is the width of the widest character in the font. For a fixed-pitch font, these values are the same. (For the font illustrated in Figure 4-3, these values are 7 and 14, respectively.) 
      

  3.   

    我的英文不太好,能不能这样解释一下:(tmHeight表示什么)