CatchFont()
Posted: Fri Sep 02, 2005 9:13 pm
This would be so wonderful !!!


Num3 wrote:This would be so wonderful !!!
Code: Select all
i.l = 1
notok = #True
If OpenLibrary(1, "Gdi32.dll")
proc.l = IsFunction(1, "AddFontMemResourceEx")
If proc
CallFunction(1, "AddFontMemResourceEx", ?font1_start, ?font1_end - ?font1_start, 0, @i)
notok = #False
EndIf
CloseLibrary(1)
EndIf
If notok
If CreateFile(0, "fixed_01.ttf")
WriteData(?font1_start, ?font1_end - ?font1_start)
CloseFile(0)
AddFontResource_("fixed_01.ttf")
SendMessage_(#HWND_BROADCAST,#WM_FONTCHANGE,0,0)
Else
MessageRequester("Fehler", "Konnte eine Resource nicht laden")
End
EndIf
EndIf
LoadFont(#fnt_small, "fixed_v01", 6)
...
DataSection
font1_start:
IncludeBinary "Data\fixed_01.ttf"
font1_end:
EndDataSection