谁知道GetFontData 这个函数的用法,最好有例子。

vbhua 2002-05-16 12:02:19
Declare Function GetFontData Lib "gdi32" Alias "GetFontDataA" (ByVal hdc As Long, ByVal dwTable As Long, ByVal dwOffset As Long, lpvBuffer As Any, ByVal cbData As Long) As Long
说明
接收一种可缩放字体文件的数据。随后,可用这些数据将字体信息嵌入一个文档。如果需要在文档使用一种特殊字体,同时这种字体在大多数系统中都不常见,而且程序员希望文档无论如何都要显示这种字体,那么这种技术就相当有用了
...全文
481 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
vbhua 2002-05-19
  • 打赏
  • 举报
回复
可否给个例子,我程序中用到了自己做的一种字体。本来我想把这个字体拷入Fonts目录,但必须要重新启动系统才能用。
zyl910 2002-05-18
  • 打赏
  • 举报
回复
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q241020
gump2000 2002-05-18
  • 打赏
  • 举报
回复
以上资料来源于袁飞API工具
建议下载:
ygyuan.3322.net
zyl910 2002-05-18
  • 打赏
  • 举报
回复

HDC hdc, // handle to device context
DWORD dwTable, // metric table to query
DWORD dwOffset, // offset into table being queried
LPVOID lpvBuffer, // pointer to buffer for returned data
DWORD cbData // length of data to query
);

Parameters
hdc
Handle to the device context.
dwTable
Specifies the name of a font metric table from which the font data is to be retrieved. This parameter can identify one of the metric tables documented in the TrueType Font Files specification published by Microsoft Corporation. If this parameter is zero, the information is retrieved starting at the beginning of the font file.
dwOffset
Specifies the offset from the beginning of the font metric table to the location where the function should begin retrieving information. If this parameter is zero, the information is retrieved starting at the beginning of the table specified by the dwTable parameter. If this value is greater than or equal to the size of the table, an error occurs.
lpvBuffer
Pointer to a buffer to receive the font information. If this parameter is NULL, the function returns the size of the buffer required for the font data.
cbData
Specifies the length, in bytes, of the information to be retrieved. If this parameter is zero, GetFontData returns the size of the data specified in the dwTable parameter.
Return Values
If the function succeeds, the return value is the number of bytes returned.

If the function fails, the return value is GDI_ERROR.

Windows NT: To get extended error information, callGetLastError.

Remarks
An application can sometimes use the GetFontData function to save a TrueType font with a document. To do this, the application determines whether the font can be embedded by checking the otmfsType member of the OUTLINETEXTMETRIC structure. If bit 1 of otmfsType is set, embedding is not permitted for the font. If bit 1 is clear, the font can be embedded. If bit 2 is set, the embedding is read-only. If embedding is permitted, the application can retrieve the entire font file, specifying zero for the dwTable, dwOffset, and cbData parameters.

If an application attempts to use this function to retrieve information for a non-TrueType font, an error occurs.

QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in wingdi.h.
Import Library: Use gdi32.lib.

See Also
Fonts and Text Overview, Font and Text Functions, GetTextMetrics, OUTLINETEXTMETRIC
gump2000 2002-05-18
  • 打赏
  • 举报
回复
【函数】
GetFontData

【操作系统】
Win9X:Yes
WinNT:Yes

【声明】
GetFontData Lib "gdi32" Alias "GetFontDataA" (ByVal hdc As Long, ByVal dwTable As Long, ByVal dwOffset As Long, lpvBuffer As Any, ByVal cbData As Long) As Long

【说明】

接收一种可缩放字体文件的数据。随后,可用这些数据将字体信息嵌入一个文档。如果需要在文档使用一种特殊字体,同时这种字体在大多数系统中都不常见,而且程序员希望文档无论如何都要显示这种字体,那么这种技术就相当有用了
在VB里使用
未经测试
Use with VB:Untested

【返回值】


【其它】


【参数表】


7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧