TEXTMETRIC 结构详解

函数GetTextMetrics可以获取一个字体文本度量并将它放入一个类型为TEXTMETRIC的数据结构中,该结构如下所示:

typedef struct ta

TEXTMETRIC
The TEXTMETRIC structure contains basic information about a physical font. All sizes are specified in logical units; that is, they depend on the current mapping mode of the display context.

typedef struct tagTEXTMETRIC { 
  LONG tmHeight; 
  LONG tmAscent; 
  LONG tmDescent; 
  LONG tmInternalLeading; 
  LONG tmExternalLeading; 
  LONG tmAveCharWidth; 
  LONG tmMaxCharWidth; 
  LONG tmWeight; 
  LONG tmOverhang; 
  LONG tmDigitizedAspectX; 
  LONG tmDigitizedAspectY; 
  TCHAR tmFirstChar; 
  TCHAR tmLastChar; 
  TCHAR tmDefaultChar; 
  TCHAR tmBreakChar; 
  BYTE tmItalic; 
  BYTE tmUnderlined; 
  BYTE tmStruckOut; 
  BYTE tmPitchAndFamily; 
  BYTE tmCharSet; 
} TEXTMETRIC, *PTEXTMETRIC; Members
tmHeight 
Specifies the height (ascent + descent) of characters. 
tmAscent 
Specifies the ascent (units above the base line) of characters. 
tmDescent 
Specifies the descent (units below the base line) of characters. 
tmInternalLeading 
Specifies the amount of leading (space) inside the bounds set by the tmHeight member. Accent marks and other diacritical characters may occur in this area. The designer may set this member to zero. 
tmExternalLeading 
Specifies the amount of extra leading (space) that the application adds between rows. Since this area is outside the font, it contains no marks and is not altered by text output calls in either OPAQUE or TRANSPARENT mode. The designer may set this member to zero. 
tmAveCharWidth 
Specifies the average width of characters in the font (generally defined as the width of the letter x). This value does not include the overhang required for bold or italic characters. 
tmMaxCharWidth 
Specifies the width of the widest character in the font. 
tmWeight 
Specifies the weight of the font. 
tmOverhang 
Specifies the extra width per string that may be added to some synthesized fonts. When synthesizing some attributes, such as bold or italic, graphics device interface (GDI) or a device may have to add width to a string on both a per-character and per-string basis. For example, GDI makes a string bold by expanding the spacing of each character and overstriking by an offset value; it italicizes a font by shearing the string. In either case, there is an overhang past the basic string. For bold strings, the overhang is the distance by which the overstrike is offset. For italic strings, the overhang is the amount the top of the font is sheared past the bottom of the font. 
The tmOverhang member enables the application to determine how much of the character width returned by a GetTextExtentPoint32 function 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 minus the overhang.

tmDigitizedAspectX 
Specifies the horizontal aspect of the device for which the font was designed. 
tmDigitizedAspectY 
Specifies the vertical aspect of the device for which the font was designed. The ratio of the tmDigitizedAspectX and tmDigitizedAspectY members is the aspect ratio of the device for which the font was designed. 
tmFirstChar 
Specifies the value of the first character defined in the font. 
tmLastChar 
Specifies the value of the last character defined in the font. 
tmDefaultChar 
Specifies the value of the character to be substituted for characters not in the font. 
tmBreakChar 
Specifies the value of the character that will be used to define word breaks for text justification. 
tmItalic 
Specifies an italic font if it is nonzero. 
tmUnderlined 
Specifies an underlined font if it is nonzero. 
tmStruckOut 
Specifies a strikeout font if it is nonzero. 
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.

gTEXTMETRIC { // tm 
    LONG tmHeight;                  //字符高度
    LONG tmAscent;                  //字符上部高度(基线以上)
    LONG tmDescent;                 //字符下部高度(基线以下)
    LONG tmInternalLeading;         //由tmHeight定义的字符高度的顶部空间数目
    LONG tmExternalLeading;         //加在两行之间的空间数目
    LONG tmAveCharWidth;            //平均字符宽度
    LONG tmMaxCharWidth;            //最宽字符的宽度
    LONG tmWeight;                  //字体的粗细轻重程度
    LONG tmOverhang;                //加入某些拼接字体上的附加高度
    LONG tmDigitizedAspectX;        //字体设计所针对的设备水平方向
    LONG tmDigitizedAspectY;        //字体设计所针对的设备垂直方向
    BCHAR tmFirstChar;              //为字体定义的第一个字符
    BCHAR tmLastChar;               //为字体定义的最后一个字符
    BCHAR tmDefaultChar;            //字体中所没有字符的替代字符
    BCHAR tmBreakChar;              //用于拆字的字符
    BYTE tmItalic;                  //字体为斜体时非零
    BYTE tmUnderlined;              //字体为下划线时非零
    BYTE tmStruckOut;               //字体被删去时非零
    BYTE tmPitchAndFamily;          //字体间距(低4位)和族(高4位)
    BYTE tmCharSet;                 //字体的字符集
} TEXTMETRIC;

转载于:https://www.cnblogs.com/songtzu/p/3539782.html

TEXTMETRIC 结构详解相关推荐

  1. Windows GPT磁盘GUID结构详解

    前一篇 Windows磁盘MBR结构详解 中我们介绍了Basic Disk中的Master Boot Record结构.GPT Disk作为Windows 2003以后引入的分区结构.使用了GUID分 ...

  2. 微信小程序01【目录结构详解、视图与渲染、事件、input、scroll-view】

    学习地址:https://www.bilibili.com/video/BV1sx411z77P 笔记01:https://blog.csdn.net/weixin_44949135/article/ ...

  3. angular 标准目录结构_Angular-cli新建项目目录结构详解

    Angular-cli新建项目目录结构详解 在上一篇博客中我们已经通过Angular CLI命令行工具创建出来一个全新的Angular项目,要想写项目,首先我们要先搞清楚项目的目录结构是怎样的,每个文 ...

  4. [java] 虚拟机(JVM)底层结构详解[转]

    [java] 虚拟机(JVM)底层结构详解[转] 本文来自:曹胜欢博客专栏.转载请注明出处:http://blog.csdn.net/csh624366188 在以前的博客里面,我们介绍了在java领 ...

  5. mysql数据库存储引擎和索引的描述_Mysql InnoDB引擎的索引与存储结构详解

    前言 在Oracle 和SQL Server等数据库中只有一种存储引擎,所有数据存储管理机制都是一样的. 而MySql数据库提供了多种存储引擎.用户可以根据不同的需求为数据表选择不同的存储引擎,用户也 ...

  6. JMETER目录结构详解

                                                                 JMETER目录结构详解 JMETER安装完成之后会有很多目录文件,我们对JM ...

  7. Android4.0源码目录结构详解

    Android4.0源码目录结构详解 Android4.0与2.1目录差不多 alsa这块,注意external/tinyalsa下有: include/tinyalsa/asoundlib.h mi ...

  8. IPv4头部结构详解

    IPv4头部结构详解 以下为书中原文摘录:

  9. 搞一下 车载以太网实战 | 01 车载以太网帧结构详解

    前言 搞SOA.搞 AP & CP AUTOSAR.搞异构SoC.搞车载以太网.搞车载OS等就找搞一下汽车电子. 全系内容可在<搞一下汽车电子>后台回复 "系列" ...

最新文章

  1. SHELL学习 续2
  2. java下拉框选择_java中下拉框选项内容
  3. 每天进步一点点:(11)进程优先级学习 nice
  4. AcWing - 175 电路维修(思维建边+最短路)
  5. vamei java_java Vamei快速教程20 GUI
  6. ps 替换文字_Python操作PPT实现自动查找替换
  7. 漫步最优化三十一——梯度法
  8. arcgis栅格邻域统计_运用ArcGIS进行影像分类
  9. weiit-saas搭建部署教程
  10. matlab ones size,matlab中zeros 和 ones 这两个函数的用法以及size的用法,princomp,pcacov,pcares,barttest四大分析函数用法...
  11. 抽奖随机滚动_老板让我做年会抽奖系统,我用Excel制作内定抽到自己的大奖!...
  12. 传奇开服技术服务端各文件代表着什么意思
  13. springboot中使用@Transactional注解事物不生效的原因
  14. excel宏 java,Microsoft Excel宏运行Java程序
  15. 游戏开发人员需要看的书籍
  16. deepdive案例实验中的所遇问题即解决
  17. 研究生宿舍大盘点!令人羡慕的研究生宿舍来了!
  18. Unity Labs:AutoLOD –试验自动性能改进
  19. 软件管家出错的情况下安装keil5
  20. Android 高仿微信头像截取 打造不一样的自定义控件

热门文章

  1. c语言修仙东君嗯哼,C语言修仙
  2. linux查看服务依赖关系图,技术|教你如何在Fedora,CentOS,RHEL中检查RPM包的依赖性
  3. mysql 对多列进行排序 分组,尝试从多列全文mysql搜索中对结果进行排序
  4. html5支持原生js,HTML5怎么学原生的js?让你对前端有了新的认识
  5. linux下hg无法运行_千万不要运行的 Linux 命令
  6. Fluid 架构创新论文被国际数据库顶会 ICDE 录用
  7. 从消息到数据湖:看 Apache RocketMQ、Hudi、Kyuubi 最新进展
  8. string java getbytes_从 String.getBytes 理解 Java 编码和解码
  9. boost安装_编译安装Mysql详细步骤
  10. effective typescript_初学typescript(一) - 来亦何哀