minib3d + max2d - problem loading font

BlitzMax Forums/MiniB3D Module/minib3d + max2d - problem loading font

Beaker(Posted 2009) [#1]
I can get DrawText working fine using Oddballs code here. But I can't get a different font to load using LoadImageFont/SetImageFont. I normally copy the font to my app folder and load it from there which works fine in other projects.

Any ideas why it doesn't work?


Beaker(Posted 2009) [#2]
I found the problem, but I'm not sure how to fix it. I'm using Framework to load minib3d. If I use import I can load the font. I tried using Framework and then importing max2d but this didn't work either. I don't really understand why it doesn't throw an error or something.


Tommo(Posted 2009) [#3]
You need to import font modules too, like BRL.Freetypefont.
Using Framework will only import BRL.Blitz. If you don't specify a Framework, all modules form BRL and PUB will get imported.


Beaker(Posted 2009) [#4]
Thanks for that. I mostly understand how modules/frameworks work, but I was just very surprised that an absent module didn't throw an error. Maybe it's particular to fonts.


Brucey(Posted 2009) [#5]
but I was just very surprised that an absent module didn't throw an error

Some modules are setup to load with "factories". This allows a more pluggable framework, but of course you need to remember to import the specific modules from which you require that functionality.
One other example is the need to import BRL.RamStream if you want to use IncBin.