Fonts with Blitz Max

BlitzMax Forums/BlitzMax Beginners Area/Fonts with Blitz Max

AD(Posted 2008) [#1]
I've seen some cool examples of Fonts (not graphical fonts loaded in) used in Blitz Max games.

Questions

1) I've seen examples of Alpha blending fonts that look really cool. How are they done?
2) How do you prevent problems of the font not being available on target computers? Is it just a case of including the font file? Or is this bad practise?
3) What is the right way to handle fonts?
4) Can you make fonts have a soft edge (anti-alias) and not look blocky like on the old Blitz Basic 2D version?

Any tutorials, code samples, etc of using Fonts would be great.

Thanks.


plash(Posted 2008) [#2]
1) I dunno, got any links? Probably using png/bitmap or TrueType fonts.
2) If you have the correct copy-rights to the font(s), yes.
3) Check the documentation and search the forums. LoadImageFont, SetImageFont and DrawText.
4) You should be able to, I haven't really used fonts that much - I'm currently doing a lot of software.

TrueType font example from http://www.blitzbasic.com/Community/posts.php?topic=43626
Note: The path to the font may be incorrect for your system (most likely not).
Graphics 640, 480, 0

Local NewFont:TImageFont = LoadImageFont("C:/windows/fonts/arial.ttf", 20)

SetImageFont NewFont

DrawText "Hit A Key...", 10, 10

Flip
WaitKey()

Graphics 640, 480, 0

DrawText "Hit A Key...", 10, 10

Flip
WaitKey()

End



tonyg(Posted 2008) [#3]
I would use Fontext or another bitmap font module (there are a few available).


mulawa1(Posted 2008) [#4]
I found this tute very useful:

http://www.2dgamecreators.com/tutorials/gameprogramming/fonts/T1_fonts.html

Peter