LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: sprite on July 28, 2003, 03:07:44

Title: Fonts
Post by: sprite on July 28, 2003, 03:07:44
Hi ,

Does LWJGL provide any support for fonts ?  I've been able to get a demo of bitmap fonts using textures and display lists running, but I'd like to use something other than a bitmap font : /  I am really at a loss for options.

(It doesn't have to be cross platform... I'm trying to make this work for WindowsXP)

^^
sprite
Title: Fonts
Post by: princec on July 28, 2003, 07:57:29
If you want to use any other kind of font than bitmap fonts... chances are you're not writing a game :) But otherwise no, we don't support any other kind of font. I think you could probably do wonders using Java's fonts and extruding solids etc. from the Shape2Ds they produce but then again there's a few other things out there which might be simple, like the wgl font stuff.

Cas :)
Title: Fonts
Post by: sprite on July 28, 2003, 08:10:06
Hehe I am writing a game :)  My problem is that I can't find any fonts.  The only bitmap fonts I've found are from the 2D font tutorial from gametutorials.com (ported to LWJGL by CH*MAN) - there are only two :(  Do you know of a good place to pick up more bitmap fonts ?

I'll look into java's stuff.
Title: Fonts
Post by: psiegel on July 28, 2003, 12:30:14
Personally, I wrote a little script that uses AWT to load up a font and draws each ascii value from 0-127 to an image using that font, then saves it out as a png.  If you want to get fancy with it, you could even store each individual character's size calculated by FontMetrics for use when laying out your polygons.

A word for the wary though, you should look very carefully at the legality of distributing various fonts.  Many fonts are free for personal use, but not for commercial distribution.

Paul
Title: Fonts
Post by: princec on July 28, 2003, 13:09:01
I render out my fonts beforehand too and keep a note of all the metrics.

RE: the legality of fonts, it is of course entirely legal to render them and distribute them in this format as a bitmap. The copyright is with the font file itself, not its rendered representation. Otherwise you'd have terrible difficulty if you worked in poster design etc etc wouldn't you :D

Cas :)
Title: Fonts
Post by: mac on July 28, 2003, 13:10:00
Hi,

i throught using  in GL is not that Problem ?

- Jens
Title: Fonts
Post by: psiegel on July 28, 2003, 15:03:05
I thought that might be the case, but I couldn't find any kind of legal language backing that argument up.  In the end, I decided to just avoid any problems by only using fonts that were clearly marked as free for commercial use.

Paul