LoadImageFont

BlitzMax Forums/BlitzMax Beginners Area/LoadImageFont

z80jim(Posted 2005) [#1]
Although not clear in the documentation I'm assuming this will load a system or True Type font for use with DrawText.

How do I specify the font URL on Mac OS X?

Thanks,
Jim


z80jim(Posted 2005) [#2]
Disregard the question. I've figured it out.

Thanks,
Jim


MrCredo(Posted 2005) [#3]
write your answer :-)
i don't know what to do with this...


z80jim(Posted 2005) [#4]
I took the easy path with this one and just dropped my True Type fonts in my game folder and don't need to specify the path in LoadImageFont. I guess it defaults to the application's folder.

I do have a followup question through. The fonts don't seem to render very nicely in my game. I'm using them at 10 - 18 point and they seem to have the jaggies. Not knowing much about BMax drawing I'm wondering if BMax doesn't use the OS X ( or Windows ) fond rendering and is somehow converting them and drawing them in Open GL.

Regards,
Jim


xlsior(Posted 2005) [#5]
Does the Scale command apply to fonts as well?

If so, you may be able to set them at a larger fonts size, and use the Scale command to apply an smoothing effect?


z80jim(Posted 2005) [#6]
Interesting thought. Scale does apply to DrawText. I'll give it a try.


MrCredo(Posted 2005) [#7]
bbmax convert fonts to images and draw this.


xlsior(Posted 2005) [#8]
also, I noticed that there is another parameter to the LoadFont command: style=smoothfont

May want to experiment with that one as well, the manual doesn't seem to mention anything about what it does... Not sure if if applies some smoothing at the default size, or if it's juse an alias for the 'filteredimage' style, which results in the image being smoothed when images are scaled or rotated.


MrCredo(Posted 2005) [#9]
it think, this is filteredimage... i tryed to disable it, but i see no effect...


Steve Elliott(Posted 2005) [#10]
z80jim could you post some code? Because I can't seem to reload my fonts - possible bug.


Grisu(Posted 2005) [#11]
Its a bug or hidden feature! ;)


skidracer(Posted 2005) [#12]
DrawText is affected by the blend mode so my guess is you haven't done a SetBlend ALPHABLEND before drawinng your text, hence no antialiasing.


z80jim(Posted 2005) [#13]
Steve,

There really is no code to post. At program startup I do this:

LoadImageFont( "GillSans.dfont", 14 )

The font file is in my application directory which appears to be the default location for finding it.

Then:

SetScale( 1.0, 1.0 )

Later I just drawText.


Steve Elliott(Posted 2005) [#14]
Yep it's a bug in BlitzMax - apparently it'll be fixed next week.

See here:
http://www.blitzbasic.com/Community/posts.php?topic=44591