How can i load a font, i.e. from the executable directory, that is not installed in the FONTS directory?
Maybe PB could have a catchfont() command, so fonts could be included in the executable binary...

Thanks for the tip!maw wrote:You can do an IncludeBinary on the font and use AddFontMemResourceEx to catch it. Or if you prefer to have the font as a file you use AddFontResourceEx.
http://msdn2.microsoft.com/en-us/library/ms533942.aspx
http://msdn2.microsoft.com/en-us/library/ms533937.aspx
Assuming you are using Windows that is. If not, I haven't got a clue
Code: Select all
LoadFont(0,GetCurrentDirectory()+"accid.ttf",18)
Code: Select all
OpenLibrary(0,"gdi32.dll")
fontid=CallFunction(0,"AddFontMemResourceEx",?font,?end_font-?font,0,@"1")
CloseLibrary(0)
LoadFont(0,"anorexia",12)
DataSection
font:
IncludeBinary "anorexia.fon"
end_font:
EndDataSection
Code: Select all
OpenLibrary(0,"gdi32.dll")
AddFontResource_(GetCurrentDirectory()+"anorexia.fon")
SendMessage_(#HWND_BROADCAST, #WM_FONTCHANGE, 0, 0)
CloseLibrary(0)
LoadFont(0,"anorexia",12)