11-27-2009 11:19 PM
I am doing some OpenGL programming but OpenGL does not include any drawing-text functions in it's standard so I am trying to create a dynamic OpenGL font system using some open source code. Because of this I need to know a couple values that are not present in RIM's font system.
First, how do you get the width of the glyph and the glyph only? I know I can get it's advance but I don't need that right now.
Second, how do you get the FontMetrics? The function getMetrics requires you to add a FontMetrics object, but this object does not include a constructor and cannot be created.
Am I missing something on how to do this?
11-30-2009 04:13 PM
So does anyone know how to get only the glyph width or how to set a FontMetrics object?
11-30-2009 09:37 PM - edited 11-30-2009 09:37 PM
Perhaps in OpenGL proper text rendering is standard, but I don't think there is in ES. There is a lot out there about how text rendering is handled in GL ES on other platforms that may be similarly applicable.
11-30-2009 10:51 PM
OpenGL ES doesn't have a standard for text rendering and I did some searches and came across what seems like a good text library but it requires the font width and I only have the font advance. It doesn't seem like a big deal but I haven't fully wrapped my head around how the whole library works so I don't want to take chances. I am using this library because I want some "constant" that I can use over and over without needing to re-hack together some font rendering code.
I am also encountering problems with changing the camera matrix (so I can actually see what the text looks like, if it is even working) and so I tried running it on a physical device but ran into issues (http://supportforums.blackberry.com/t5/Java-Develo
Finally the last problem I am having is there is no way to create a new FontMetrics object (no constructor) and the function to get it (getMetrics) requires the object as a parameter. So I don't know how to do this right now and am hoping for someone who knows about fonts (they don't need to know OpenGL) to hopefully have an answer. Thanks for posting though, sorry for the rant and rehash.