Цитата sashadeg:
Не получается использовать шрифт "visitor"
Уже по всякому пробЫвал... И прописывал "visitor" и название которое в папке "Шрифты" ... ничего..
Даёте пожалуйста пример с этим шрифтом... »
|
Вот смотри. Работает без установки в
WINDOWS\Fonts.
Код:

#Include <SendMessage.au3>
_WinAPI_AddFontResource('visitor.ttf')
GUICreate('Test', 300, 100)
$Label = GUICtrlCreateLabel('Visitor TT2 BRK', 10, 34, 280, 80, 0x01)
GUICtrlSetFont(-1, 30, 400, 0, 'Visitor TT2 BRK')
GUISetState()
do
until GUIGetMsg() = -3
_WinAPI_RemoveFontResource('visitor.ttf')
func _WinAPI_AddFontResource($sFont)
local $Ret = DllCall('gdi32.dll', 'int', 'AddFontResource', 'str', $sFont)
if (@error) or ($Ret[0] = 0) then
return SetError(1, 0, 0)
endif
_SendMessage(0xFFFF, 0x001D, 0, 0)
return SetError(0, 0, $Ret[0])
endfunc; _WinAPI_AddFontResource
func _WinAPI_RemoveFontResource($sFont)
local $Ret = DllCall('gdi32.dll', 'int', 'RemoveFontResource', 'str', $sFont)
if (@error) or ($Ret[0] = 0) then
return SetError(1, 0, 0)
endif
_SendMessage(0xFFFF, 0x001D, 0, 0)
return SetError(0, 0, $Ret[0])
endfunc; _WinAPI_RemoveFontResource