user-0 提问: 大写字母宽度

回复:
user: user-0
content: +1什么意思

user: user-1
content: 引用 1 楼 u013491662 的回复:tm.tmPitchAndFamily & 1 ? 3 : 2 的意思是 tm.tmPitchAndFamily的2进制位的最低位是否为1 tm.tmPitchAndFamily & 1 为1此值为1 为0此值为0 根据这个值执行条件运算符的值为3还是为2+1

user: user-0
content: 看不懂英文……

user: user-2
content: GetTextExtentPoint32 The GetTextExtentPoint32 function computes the width and height of the specified string of text.   BOOL GetTextExtentPoint32(   HDC hdc,           // handle to device context   LPCTSTR lpString,  // pointer to text string   int cbString,      // number of characters in string   LPSIZE lpSize      // pointer to structure for string size );   Parameters hdc  Handle to the device context.  lpString  Pointer to the string of text. The string does not need to be zero-terminated, since cbString specifies the length of the string.  cbString  Specifies the number of characters in the string.  lpSize  Pointer to a SIZE structure in which the dimensions of the string are to be returned.  Return Values If the function succeeds, the return value is nonzero.  If the function fails, the return value is zero.   Windows NT: To get extended error information, callGetLastError.   Remarks The GetTextExtentPoint32 function uses the currently selected font to compute the dimensions of the string. The width and height, in logical units, are computed without considering any clipping.   Because some devices kern characters, the sum of the extents of the characters in a string may not be equal to the extent of the string.   The calculated string width takes into account the intercharacter spacing set by the SetTextCharacterExtra function.   Windows CE: The GetTextExtentPoint32 function is identical to the GetTextExtentPoint function.  QuickInfo   Windows NT: Requires version 3.5 or later.   Windows: Requires Windows 95 or later.   Windows CE: Requires version 2.0 or later.   Header: Declared in wingdi.h.   Import Library: Use gdi32.lib.   Unicode: Implemented as Unicode and ANSI versions on Windows and Windows NT.  See Also Fonts and Text Overview, Font and Text Functions, SetTextCharacterExtra, SIZE

user: user-2
content: tmPitchAndFamily  Specifies information about the pitch, the technology, and the family of a physical font.  The four low-order bits of this member specify information about the pitch and the technology of the font. A constant is defined for each of the four bits: Constant Meaning  TMPF_FIXED_PITCH If this bit is set the font is a variable pitch font. If this bit is clear the font is a fixed pitch font. Note very carefully that those meanings are the opposite of what the constant name implies.  TMPF_VECTOR If this bit is set the font is a vector font.  TMPF_TRUETYPE If this bit is set the font is a TrueType font.  TMPF_DEVICE If this bit is set the font is a device font.     An application should carefully test for qualities encoded in these low-order bits, making no arbitrary assumptions. For example, besides having their own bits set, TrueType and PostScript fonts set the TMPF_VECTOR bit. A monospace bitmap font has all of these low-order bits clear; a proportional bitmap font sets the TMPF_FIXED_PITCH bit. A Postscript printer device font sets the TMPF_DEVICE, TMPF_VECTOR, and TMPF_FIXED_PITCH bits.   The four high-order bits of tmPitchAndFamily designate the font's font family. An application can use the value 0xF0 and the bitwise AND operator to mask out the four low-order bits of tmPitchAndFamily, thus obtaining a value that can be directly compared with font family names to find an identical match. For information about font families, see the description of the LOGFONT structure.    C:\Program Files\Microsoft Visual Studio\VC98\Include\WINGDI.H:     839: /* tmPitchAndFamily flags */     840: #define TMPF_FIXED_PITCH    0x01     841: #define TMPF_VECTOR             0x02     842: #define TMPF_DEVICE             0x08     843: #define TMPF_TRUETYPE       0x04

user: user-0
content: 原来最低位为1是变宽字符  那程序运行中，按大小写切换键换成大写，由于不会触发create事件，cxCap不会改变，不是就出错了吗

user: user-0
content: tm.tmPitchAndFamily的低4位是字符间距，最低位是1有什么实际含义吗？这与求大写字母平均宽度有什么联系吗

user: user-2
content: if (0!=(tm.tmPitchAndFamily & 1)) {     cxCaps = 3 * cxChar / 2 ; } else {     cxCaps = 2 * cxChar / 2 ; }

user: user-3
content: tm.tmPitchAndFamily & 1 ? 3 : 2 的意思是 tm.tmPitchAndFamily的2进制位的最低位是否为1 tm.tmPitchAndFamily & 1 为1此值为1 为0此值为0 根据这个值执行条件运算符的值为3还是为2

user: user-0
content: 也是  大一了还不能完全看懂真是有愧

user: user-2
content: 英语也是一门计算机语言的说。