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- ...
随机推荐
- Linux下安装使用Redis
cd /usr/local/src //进入src目录 wget http://download.redis.io/releases/redis-4.0.1.tar.gz //下载到src ...
- 使用 MSIX 打包 DotNetCore 3.0 客户端程序
如何你希望你的 WPF 程序能够以 Windows 的保护机制保护起来,不被轻易反编译的话,那么这篇文章应该能帮到你. 介绍 MSIX 是微软于去年的 Windows 开发者日峰会 上推出的全新应用打 ...
- 阿里巴巴矢量图标库(Iconfont)-利于UI和前端的搭配
前端时间,做一个小网站的时候,需要用到很多小图标,UI设计好之后不知道如何使用,如果使用图片那会很麻烦,相信一些前端更喜欢iconfont这样的标签直接调用,这样包括颜色和大小以及使用都更方便快捷,于 ...
- 小tips:JS的Truthy和Falsy(真值与假值)
前言 Truthy 不等于 ture,他是指是在Boolean上下文中转换后的值为真的值.我的理解是,在javascript中所有表达式为true的值.同理Falsy指的是在javascript中所有 ...
- react异步加载组件
1. 创建 asyncComponent 异步加载工具 import React from 'react' function asyncComponent(loadComponent){ class ...
- sparkSQL catalyst
最近想来,大数据相关技术与传统型数据库技术很多都是相互融合.互相借鉴的.传统型数据库强势在于其久经考验的SQL优化器经验,弱势在于分布式领域的高可用性.容错性.扩展性等,假以时日,让其经过一定的改造, ...
- maven生成项目慢解决办法
maven生成项目慢,原因:在线更新archetype-catalog.xml文件,从Apache中央仓库. 解决办法,手动下载,放到maven环境. 备用下载地址: https://files.cn ...
- C++一些基本数据结构:字面常量、符号常量、枚举常量
常量:C++包括两种常量,字面常量和符号常量. 字面常量:指的是直接输入到程序中的值 比如:in myAge=26: myAge是一个int类型变量,而26是一个字面常量. 符号常量:指的是用名称表示 ...
- QPushButton class
Help on class QPushButton in module PyQt5.QtWidgets: class QPushButton(QAbstractButton) | QPushButt ...
- dedecms织梦的不同栏目调用不同banner图的方法
在做织梦站的时候我们会有不同的栏目,比如联系我们,产品中心等等,banner也不一样,方法如下: 我们可以使用织梦的顶级栏目ID标签,把图片命名成顶级栏目typeid ,代码如下: <img s ...