
CatchFont()
-
- PureBasic Expert
- Posts: 2812
- Joined: Fri Apr 25, 2003 4:51 pm
- Location: Portugal, Lisbon
- Contact:
CatchFont()
This would be so wonderful !!!


Re: CatchFont()
Num3 wrote:This would be so wonderful !!!

va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Re: CatchFont()
I know this is the "feature requests and wishlists" but did you see
this example code on using AddFontMemResourceEx() posted by
freedimension some time ago?
this example code on using AddFontMemResourceEx() posted by
freedimension some time ago?
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
Good programmers don't comment their code. It was hard to write, should be hard to read.