Fonts

Started by sprite, July 28, 2003, 03:07:44

Previous topic - Next topic

sprite

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

princec

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 :)

sprite

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.

psiegel

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

princec

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 :)

mac

Hi,

i throught using  in GL is not that Problem ?

- Jens
he Network is the Music
www.mac-systems.de

psiegel

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