GDI应用程序无法在win x64上从打印机驱动程序加载设备字体 [英] GDI application can not load device font from printer driver on win x64
问题描述
我有一个GDI应用程序用于从打印机驱动程序获取设备字体。在打印机驱动程序中,DrvQueryFont函数返回指向设备字体数据结构(PIFIMETRICS)的指针。 GDI渲染引擎将调用此函数,以便为当前打印机支持的设备字体。问题是,它在32位环境中正常工作,但在64位环境中不起作用。请帮忙。
我的尝试:
+申请时starts:由GDI调用DrvQueryFont()函数以获取给定字体的IFIMETRICS结构。我们已经了解了MSDN(微软开发者网络)上的IFIMETRICS结构。
+在IFIMETRICS结构的备注中写道:IFIMETRICS结构的Align成员使得它对于x64机器比x32更大根据这种结构格式化的二进制字体格式文件的分支。从Windows Server 2003 SP1开始,Prntfont.h增加了一个固定大小的结构:PRINTIFI32.PRINTIFI32结构与IFIMETRICS结构相同,除了它不包含Align成员。
+我们猜测IFIMETRICS结构的Align成员是造成这个问题的原因。
+我们试图改变IFIMETRICS PRINTIFI32结构的结构来修复这个缺陷,但是这个问题仍然存在
I have a GDI application used to get device fonts from a printer driver. In the printer driver, DrvQueryFont function returns the pointer to the device font data structure (PIFIMETRICS). This function will be called by GDI rendering engine to give the device fonts that are supported by current printer. The problem is that, it works correctly on 32-bit environment, but doesn't work on 64-bit environment. Please help.
What I have tried:
+ When application starts: the DrvQueryFont() function is called by GDI to get the IFIMETRICS structure for a given font. we have learned about IFIMETRICS structure on MSDN (Microsoft Developer Network).
+ In the remarks for the IFIMETRICS structure is written: "The IFIMETRICS structure's Align member causes it to be larger for x64 machines than for x32 machines, which has ramifications for binary font format files formatted according to this structure. Starting with Windows Server 2003 SP1, an additional, fixed-size structure has been added to Prntfont.h: PRINTIFI32. The PRINTIFI32 structure is identical to the IFIMETRICS structure, except that it does not contain an Align member."
+ We guess that The IFIMETRICS structure's Align member is the cause of this problem.
+ We tried to change the IFIMETRICS structure to the PRINTIFI32 structure to fix this defect, but this problem still occurs
推荐答案
显然x64上的字体不正确。没有任何具体的错误?当你使用另一个(工作)字体时会发生什么?
我希望你的x64应用程序也是本机x64位并且没有bug(比如字符串作为char *或虚假缓冲区大小)否则你可能无法访问系统数据。
查看系统工具,仔细检查字体是否受支持。
寻找x64驱动程序的更新。
Obviously the font isnt correctly supported on x64. Havent to got any specific errors? What happens when you use another (working) font?
I hope that your app for x64 is also native x64 bit and free of bugs (like strings as char* or false buffer sizes) else you can have trouble in accessing system data.
Look with the system tool to double check whether the font is supported.
Look for some update of the driver for x64.
这篇关于GDI应用程序无法在win x64上从打印机驱动程序加载设备字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!