从MSDN上得知GetFontData的原型:The GetFontData function retrieves font metric data for a TrueType font. DWORD GetFontData(
  HDC hdc,           // handle to DC
  DWORD dwTable,     // metric table name
  DWORD dwOffset,    // offset into table
  LPVOID lpvBuffer,  // buffer for returned data
  DWORD cbData       // length of data
);Parameters:hdc       [in] Handle to the device context. dwTable   [in] 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  [in] 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 [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. cbData    [in] 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. 
但是缺少实例。哪位高手使用过该函数,能够提供一个实例?
不胜感激!

解决方案 »

  1.   

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

  2.   

    http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q241/0/20.asp&NoWebContent=1