Проблема с установкой шрифта
От: Аноним  
Дата: 11.07.07 07:35
Оценка:
Программно копирую ttf-файл в папку Font. Но, переодически, фонт не добавляется в реестр в
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts, хотя если тоже самое делать через проводник, все ок. Подскажите, может после копирования фонта, нужно какую-нибудь функцию вызвать?
Re: Проблема с установкой шрифта
От: Master-Win Россия  
Дата: 11.07.07 10:27
Оценка:
Здравствуйте, Аноним, Вы писали:

А>Программно копирую ttf-файл в папку Font. Но, переодически, фонт не добавляется в реестр в

А>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts, хотя если тоже самое делать через проводник, все ок. Подскажите, может после копирования фонта, нужно какую-нибудь функцию вызвать?

Что значит не добавляется. Так добавь вручную! В чем проблема то.
Re: Проблема с установкой шрифта
От: trophim Россия  
Дата: 05.01.08 20:50
Оценка:
Здравствуйте, <Аноним>, Вы писали:

А>Программно копирую ttf-файл в папку Font. Но, переодически, фонт не добавляется в реестр в

А>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts, хотя если тоже самое делать через проводник, все ок. Подскажите, может после копирования фонта, нужно какую-нибудь функцию вызвать?

Длинновато, но вот тебе из МСДН (искал аж минут 5, наверное):

To temporarily install a font, call AddFontResource or AddFontResourceEx. These functions load a font that is stored in a font-resource file. However, this is a temporary installation because after a reboot the font will not be present.

To install a font that will remain after the system is rebooted, use one of the following methods:

Go to the Control Panel, click the Fonts icon, and select Install New Fonts from the File menu. The font is available to an application even before the reboot. However, in a terminal server situation the font is available for the current session but is not available for other sessions until after a reboot.
Copy the font into the %windir%\fonts folder. Then, either go to the Control Panel and click the Fonts icon, or call AddFontResource or AddFontResourceEx. The font is available to an application even before the reboot. However, in a terminal server situation the font is available for the current session but is not available for other sessions until after a reboot. If you only copy the font into the %windir%\fonts folder, the font will be available only after the system is rebooted.
In the case of TrueType and OpenType fonts, an additional step is sometimes necessary before the font can be installed in the font table. Some font manufacturers ship only the TrueType or OpenType font-data files (identified by the .ttf extension). Before The system can load these fonts, it requires a corresponding header file (identified by the .fot extension). To create this header file, an application must call the CreateScalableFontResource function and pass the name of the font-data file as the third parameter. When this header file is created, an application can install the font by calling the AddFontResource or AddFontResourceEx function and passing the name of the new header file.


Раздел зовется Font Installation and Deletion.
[EOF]
Let it be! — Давайте есть пчелу!
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.