自造的字或字体如何加入软件或镶套如软件,自造字体如何调用?(100分)

  • 主题发起人 主题发起人 chinausa
  • 开始时间 开始时间
C

chinausa

Unregistered / Unconfirmed
GUEST, unregistred user!
自造的字或字体如何加入软件或镶套如软件,自造字体如何调用?而无须将字体文件拷贝到
WINDOWS目录中,
自造字体在自己的目录中如何调用?能否给 例子代码或控件?
谢!
 
你的问题我也遇到.怎么办?
 
如果你解决了,请告诉我!
chinausa@163.net
目前我是将其拷贝到windows目录,
 
做到资源文件里面,一旦发现机器里面没有此字体,则生成一个
 
做到res中,启动后,释放为文件再用api装,我的汉软日记通中的八卦和
汉软日历国际版6.0就采用这种方法
 
做到res中,启动后,一旦发现机器里面没有此字体,则释放为文件再用api装!
 
to hamsoft:

有具体的例子吗?我可以再给你加分!
 
AddFontResource
The AddFontResource function adds the font resource from the specified file to the system font table. The font can subsequently be used for text output by any Win32-based application.

To mark a font as private or no enumerable, use the AddFontResourceEx function.

int AddFontResource(
LPCTSTR lpszFilename // font file name
);
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 Windows 95/98 East Asian and Windows NT: 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.


Windows 2000: To add a font whose information comes from several resource files, have lpszFileName point to a string with the file names separated by a | --for example, abcxxxxx.pfm | abcxxxxx.pfb.

Return Values
If the function succeeds, the return value specifies the number of fonts added.

If the function fails, the return value is zero.

Remarks
Any application that adds or removes fonts from the system font table should notify other windows of the change by sending a WM_FONTCHANGE message to all top-level windows in the operating system. The application should send this message by calling the SendMessage function and setting the hwnd parameter to HWND_BROADCAST.

When an application no longer needs a font resource that it loaded by calling the AddFontResource function, it must remove that resource by calling the RemoveFontResource function.

This function installs the font only for the current session. When the system restarts, the font will not be present. To have the font installed even after restarting the system, the font must be listed in the registry.

Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Wingdi.h; include Windows.h.
Library: Use Gdi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
 
吕雪松的方法是对的
 
当然,如果你嫌麻烦的话程序员大本营的光盘也有一个控件可以做到。
 
to jingtao:

该控件叫什么名字?
 
名字忘记了,好像在MISC系列。
不过文件会增大很多哦。
 
多人接受答案了。
 
后退
顶部