Fonts

BlitzMax Forums/MiniB3D Module/Fonts

jkrankie(Posted 2009) [#1]
It seems that you can't use imagefonts that you have loaded with the Max2D LoadImageFont command in a Beginmax2d() bit. Is this a bug? If not/if so, what can i do to use my own font in my game? \the MiniB3D text command seems limited to only using the built in font unless i've missed something obvious.

Cheers
Charlie


jkrankie(Posted 2009) [#2]
Looking into this further, it looks like it should work. the max2d example uses imagefonts, but doesn't work either. this probably is a bug then?

Cheers
Charlie


jkrankie(Posted 2009) [#3]
Doesn't work on PPC mac either.

Cheers
Charlie


b32(Posted 2009) [#4]
Not sure why that is, but as a workaround, you can use a bitmap font instead.


ima747(Posted 2009) [#5]
Can you give an example of your code? I've never gotten imagefonts to work unless I've got the font file itself. (i.e. can't use system fonts, gotta pull the font out into my game's data directory and load it from there, doing that it works in minib3d and max2d for me)

This works for me on mac and PC, but nothing else I've tried doesn't. I can't get to the fonts in the system, can't even get the current font with GetImageFont to work properly for me. maybe I'm missing something or maybe it's just glitchy...

TextFont = LoadImageFont("Data/someFont.ttf", 10)


Do some tests in max2d to see if you can get something working there and then move it over to minib3d (that's what I did to finnally figure out I needed direct access to the font file...)


jkrankie(Posted 2009) [#6]
Ok, it seems to work if I incbin the font. Very strange...

Cheers
Charlie