Hello everyone, first post from me, so first off thanks for jME!
Currently font rendering is fixed to 10 pixel wide characters. I would propose that the Text object keep a list of character widths, such as the ones produced by the font building tool by LMNOpc. (I would also propose that the display list be built based on the text rather than one for each character, but this is less important).
The thing that makes me most nervous, however, is that the text object relies on the creator of the scene graph to ensure that the correct font texture is applied. This seems to me to be error prone. (because I think that the widths & the font texture should be logically grouped somehow)
Hint: As a general point of reference, I would recommend having a look at OpenSceneGraph (www.openscenegraph.org). It is a solidly tested, well designed scene graph.
Some of the nice features of osg (OpenSceneGraph) are:
- automatically sets the near & far clipping planes (which maximises the z buffer resolution)
- uses state sets (which are a combination of all applicable states), which are easily compared.
- supports all opengl states (including things like point size etc)
- allows arbitrary number of bins
- bins are collected into a renderstage, allowing multi-pass rendering
anyway, i’m about to modify the way text works, so let me know if you want the code.