INFO: Font Metrics and the Use of Negative lfHeight
2013-12-24 10:51
573 查看
INFO: Font Metrics and the Use of Negative lfHeight
![](http://support.microsoft.com/library/images/support/CN/print-icon-white.png)
![](http://support.microsoft.com/library/images/support/CN/email-icon.png)
Article translations
![](http://support.microsoft.com/library/images/support/CN/Caret-Translate.png)
Article ID: 32667 - View products that this article applies to.![]() Retired KB Content Disclaimer This article was previously published under Q32667 Expand all | Collapse all
![]() SUMMARY ![]() Cell Height ![]() Character Height (Also Known as Em) ![]() Internal Leading ![]() External Leading ![]() Overhang ![]() Properties ![]() Give Feedback The following illustrations show the most commonly used font metrics, including Character Height, which is selected with negative values of each illustration is followed by notes describing the metrics._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ O O _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /\ / \ / \ _ _ _ _ _ _ _ _ _ /______\ _ _ _ ___ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ / \ / \| / \ | | _ _ _ _ _ _ _ _ /_ _ _ _ _ _ \ _ \___/| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\___/_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |- External Leading _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ | O O |- Internal Leading _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ | /\ | / \ | / \ | /______\ _ _ _ ___ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Char Height -| / \ / \| | / \ | | | /_ _ _ _ _ _ \ _ \___/| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | | | | _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _\___/_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | | | O O | | | | /\ | | / \ | | / \ |- Ascent Cell Height -| /______\ ___ | | / \ / \| | | / \ | | | | /_ _ _ _ _ _ \ _ \___/| _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ | | | | | |- Descent _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _\___/_ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ Cell HeightThis is the height selected on positive lfHeight in the LOGFONT. It is the height of the font bitmap for raster fonts. It is returned as tmHeight in the TEXTMETRIC structure from GetTextMetrics().Character Height (Also Known as Em)This is the height selected on negative lfHeight in the LOGFONT. (That is, the mapper will try to match a font whose character height matches the absolute value of the requested height.)NOTE: By definition, the Em is equal to Cell Height minus Internal Leading. The Em defines the point size of a font. In MM_TEXT mapping mode, the Em is related to the point size as follows: Em=dpiY*point_size/72; // where dpiY is dots per inch in Y direction The dpiY of a font is equal to tmDigitizedAspectY in the TEXTMETRICS structure. Internal LeadingThis is returned as tmInternalLeading in the TEXTMETRIC structure from GetTextMetrics() and often, but not necessarily, describes how much space has been left inside the font bitmap for diacritical marks (accents).External LeadingThis is returned as tmExternalLeading in the TEXTMETRIC structure from GetTextMetrics() and describes how much extra space the font designer expects the application to leave between rows of the font. It is not included in the bitmap and is not modified by TextOut()/ExtTextOut(), even in OPAQUE mode. When outputting multiple lines of text, the lines should be separated by (tmHeight + tmExternalLeading).Character Width Character Width | | |-------------| |-------------| | | / / | | | / / | | | / / | | | / / | |----------| /----------/ | | | / / | | | / / | | | / / | | | / / | |________| |_____________| |_____________| | | | Overhang Character width Character width (including white space) (including white space) Overhang = 0 Overhang > 0 OverhangtmOverhang specifies the per string extra width that may be added to some synthesized fonts. When synthesizing some attributes such as bold or italic, GDI or a device may have to add width to a string on both a per character and per string basis. For example, GDI synthesizes embolding by expanding the intercharacter spacing and overstriking with an offset and italicizes a font by skewing the string.In either case, there is an overhang past the basic string. For bold strings, it is the distance by which the overstrike is offset. For italic strings, it is the amount the top of the font is skewed past the bottom of the font. tmOverhang allows the application to determine how much of the character width returned by a GetTextExtent() call on a single character is the actual character width and how much is the per string extra width. The actual width is the extent less the overhang. In other words, tmOverhang is the difference between the width of a character when it is output singly versus its width when it is in the interior of a string. For more information, look up the following topics in the Windows Software Development Kit reference: CreateFont() (in Volume 1 of the version 3.0 reference) TEXTMETRIC (in Volume 2 of the version 3.0 reference) ![]() Back to the top | Give Feedback Article ID: 32667 - Last Review: March 21, 2005 - Revision: 1.1APPLIES TO Microsoft Windows Software Development Kit 3.1
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated. ![]() Back to the top | Give Feedback |
相关文章推荐
- sysbench 测试工具的安装和使用
- 45个CSS热门资料源码打包下载
- linux之shell编程if-then-else结构
- 值对象
- ORA-00257 archiver error. 错误的处理方法
- modelsim10.1a的破解
- 第2代移动通信技术
- java 网站
- 拼接xml时出现内存溢出解决办法
- jquery-ajax、struts2、json数据问题
- 统一沟通_边缘安装及配置之十七_(Windows Server 2008 R2 SP1英文版) 推荐
- Android 系统默认音量和最大音量
- 使用Delayed job处理Rails中的异步任务
- 拼接xml时出现内存溢出解决办法
- Linux如何在系统启动时自动加载模块(转)
- 拼接xml时出现内存溢出解决办法
- Adaptive Backgrounds – jQuery 自适应背景插件
- 【稳定排名的两大核心秘诀】
- MFC_CTreeCtrl样式
- 坑爹的动车订票网站