GetFontResourceInfo 函数: 获取字体文件对应的字体名
在 win 7, gdi32.dll,找不到 GetFontResourceInfo(), 但能找到 GetFontResourceInfoW(), 用法类似。
//--------------------------------------------------------------------------------------------------------------------------------------------------
另外看到一篇,通过读取字体文件,分析结构,找到字体名: https://bbs.csdn.net/topics/390317612?list=3482466
//---------------------------------------------------------------------------------------------------------------------------------------------------
来源:http://www.undocprint.org/winspool/getfontresourceinfo
GetFontResourceInfo
The GetFontResourceInfo function retrieves information from a font resource file.
BOOL GetFontResourceInfo(
LPCTSTR lpszFilename, // font file name
LPDWORD cbBuffer, // size of buffer for resouce information
LPVOID lpBuffer, // buffer for returned resouce information
DWORD dwQueryType, // resouce information query type
);
Parameters
lpszFilename
[in] Pointer to a null-terminated character string that contains a valid font file name. This parameter can specify any of the following files. File extension Description .fon Font resource file. .fnt Raw bitmap font file. .ttf Raw TrueType file. .ttc East Asian Windows: TrueType font collection. .fot TrueType resource file. .otf PostScript OpenType font. .mmm multiple master Type1 font resource file. It must be used with .pfm and .pfb files. .pfb Type 1 font bits file. It is used with a .pfm file. .pfm Type 1 font metrics file. It is used with a .pfb file.
To add a font whose information comes from several resource files, point lpszFileName to a string with the file names separated by a | –for example, abcxxxxx.pfm | abcxxxxx.pfb.
cbBuffer
[in,out] Specifies the length, in bytes, of the information to be retrieved. If this parameter is zero, GetFontResourceInfo returns the size of the data specified in the dwQueryType parameter.
lpBuffer
[out] Pointer to a buffer that receives the font information. If this parameter is NULL, the function returns the size of the buffer required for the font data.
dwQueryType
Specifies the type of resouce information to return. This parameter can be one of the following values.
| Value | Meaning |
|---|---|
| QFR_0 0 |
DWORD or LPVOID unknown |
| QFR_DESCRIPTION 1 |
The function provides a string that an NT-based operating system will use to describe the font file. A null-terminated Unicode string is written to the buffer pointed to by lpBuffer. |
| QFR_LOGFONT 2 |
Array of LOGFONT |
| QFR_PDEV 3 |
PDEV ? |
| QFR_FONTFILE 4 |
scalable font file name |
| QFR_5 5 |
DWORD Windows XP: Always returns 0 |
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Windows NT/2000/XP: To get extended error information, call GetLastError.
Remarks
When 4 is specified in dwQueryType and lpszFilename specifies a FOT file, then lpBuffer returns the file name of the linked .ttf file.
Requirements
Windows NT/2000/XP: Included in Windows NT ? and later.
Windows 95/98/Me: Included in Windows ? and later.
Header: Declared in Wingdi.h; include Windows.h.
Library: Use Gdi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP
GetFontResourceInfo 函数: 获取字体文件对应的字体名的更多相关文章
- 从OTF字体文件里查找字体名称
for in ? 使用神器vim就好了. . . vim ./AKZIDENZGROTESK-COND.OTF
- js分析 猫_眼_电_影 字体文件 @font-face
0. 参考 https://developer.mozilla.org/zh-CN/docs/Web/CSS/@font-face 这是一个叫做@font-face 的CSS @规则 ,它允许网页开发 ...
- 第七篇:使用 fcntl 函数 获取,设置文件的状态标志
前言 当打开一个文件的时候,我们需要指定打开文件的模式( 只读,只写等 ).那么在程序中如何获取,修改这个文件的状态标志呢? 本文将告诉你如何用 fcntl函数 获取指定文件的状态标志. 解决思路 1 ...
- 使用 fcntl 函数 获取,设置文件的状态标志
前言 当打开一个文件的时候,我们需要指定打开文件的模式( 只读,只写等 ).那么在程序中如何获取,修改这个文件的状态标志呢?本文将告诉你如何用 fcntl函数 获取指定文件的状态标志. 解决思路 1. ...
- C#根据字体名通过注册表获取该字体文件路径(win10)两种方法推荐第二种
方法一: 直接先上源码: private System.Collections.Generic.SortedDictionary<string, string> ReadFontInfor ...
- MFC之向导页、消息框、文件选择、字体、颜色(三)
属性页对话框的分类 属性页对话框想必大家并不陌生,XP系统中桌面右键点属性,弹出的就是属性页对话框,它通过标签切换各个页面.另外,我们在创建MFC工程时使用的向导对话框也属于属性页对话框,它通过点击“ ...
- iOS TTF文件使用---改变字体
TTF(True Type Font):是一种字库名称 TTF文件:是Apple公司和Microsoft公司共同推出的字体文件格式 使用: 1 获取字体文件 从各种渠道下载字体ttf,网站或从别的ip ...
- Android实例-使用自定义字体文件(XE8+小米2)
结果: 1.需要修改DELPHI自身的FMX.FontGlyphs.Android.pas,复制到程序的根目录下(红色部分为修改过的). 2.字体文件从 C:\Windows\Fonts 直接拷贝到A ...
- Delphi中建立指定大小字体和读取该字体点阵信息的函数(转)
源:Delphi中建立指定大小字体和读取该字体点阵信息的函数 Delphi中建立指定大小字体和读取该字体点阵信息的函数 作者:Thermometer Email: webmaster@daheng- ...
随机推荐
- Vue.js实现后台菜单切换
因为刚初学Vue.js,暂时遇到以下问题,待之后解决 点击父节点,怎么隐藏显示子节点 点击父节点或子节点,切换li的class="active" iframe怎么自适应高度 思路 ...
- vuex的用法
https://segmentfault.com/a/1190000015782272
- 《JavaScript高级程序设计》笔记:事件(十三)
事件流 事件冒泡 IE的事件流叫做事件冒泡,即事件开始时由最具体的元素接收,然后逐级向上传播到较为不具体的节点(文档).如下代码: <body> <div id="myDi ...
- Redis 安装总结记录 附送redis-desktop-manager工具
使用redis已几年有余,之前写过Redis关于master-slave(主从)同步原理的文章.这里介绍下安装过程,因为前前后后有些命令也记不住了,所以此篇文章和之前文章一样起个备注记录作用,也供屏幕 ...
- (转)postman安装及简单使用
Postman安装与使用 2018-06-04 22:58 by 虫师, 46636 阅读, 10 评论, 收藏, 编辑 Postman一款非常流行的API调试工具.其实,开发人员用的更多.因为测试人 ...
- 我的第一个python web开发框架(37)——职位管理功能
对于职位管理,我们可以理解它为角色权限的管理,就像前面所说的一样,有了职位管理,后台管理系统绑定好对应的权限以后,新进员工.离职或岗位调整,管理员操作起来就非常的便捷了,只需要重新绑定对应职位就可以做 ...
- animation动画案例
最近一直苦恼做一个banner的进度条,原先用js改变width值,但明显卡顿.后来用了animation,超级好用. <!DOCTYPE html> <html lang=&quo ...
- 随机数据生成与对拍【c++版,良心讲解】
10.7更新:见最下面 离NOIP2018没剩多长时间了,我突然发现我连对拍还不会,于是赶紧到网上找资料,找了半天发现了一个特别妙的程序,用c++写的! 不过先讲讲随机数据生成吧. 很简单,就是写一个 ...
- 深入了解EntityFramework Core 2.1延迟加载(Lazy Loading)
前言 接下来会陆续详细讲解EF Core 2.1新特性,本节我们来讲讲EF Core 2.1新特性延迟加载,如果您用过EF 6.x就知道滥用延迟加载所带来的灾难,同时呢,对此深知的童鞋到了EF Cor ...
- React 系列教程2:编写兰顿蚂蚁演示程序
简介 最早接触兰顿蚂蚁是在做参数化的时候,那时候只感觉好奇,以为是很复杂的东西.因无意中看到生命游戏的 React 实现,所以希望通过兰顿蚂蚁的例子再学习一下 React. 兰顿蚂蚁的规则非常简单: ...