LoadImageFont

BlitzMax Forums/BlitzMax Programming/LoadImageFont

Pineapple(Posted 2009) [#1]
All I want is to set the font to courier new. Why Isn't this working?

Graphics 256,256

Global charfont=LoadImageFont("Courier New",16,0)
SetImageFont charfont



GfK(Posted 2009) [#2]
Doesn't work for two reasons.

First, you need the filename of the font, which is cour.ttf.

Second, it'll be looking for it in your app folder (its not there). If you want to load it from the windows fonts folder, you need to supply an absolute path, i.e. c:\Windows\fonts\cour.ttf.


Pineapple(Posted 2009) [#3]
works now, thanks


Ked(Posted 2009) [#4]
Or, just in case you are on Windows 95/98 or something...
GetEnv_("SYSTEMROOT")+"\fonts\fontfilename.ttf"