Question about loading fonts.

BlitzMax Forums/BlitzMax Beginners Area/Question about loading fonts.

Bukky(Posted 2006) [#1]
Hello,

I've searched this forum on how to load fonts, and I still cant get them to work :(

I'm using the following syntax:

Global a_font:TImagefont=LoadImageFont("/images/fonts/myriad.ttf",20)
SetImageFont a_font


At runtime I get the error of:

Unhandled Exception: Attempt to access field or method of Null object

Anyone know what the problem may be?


skidracer(Posted 2006) [#2]
that first slash?

Hmmm, no it's because you need to have a current graphics context (call graphics before SetImageFont), this needs to be fixed...


Bukky(Posted 2006) [#3]
Thanks! That did it!


xlsior(Posted 2006) [#4]
With the first slash in place, it will go to the images folder directly off the root directory of your current drive. Without the first slash, it will go to the images folder inside your current subdirectory.