Thanks, I will definitely check that out. I appreciate your help, and I'll let you know if I have any other questions after I dig a little deeper into fonttools.

Dave

On Wed, Jan 13, 2010 at 1:37 PM, Mike C. Fletcher <mcfletch@vrplumber.com> wrote:
David Morris wrote:
> I would like to be able to export a string of 3D extruded text as an
> OBJ or similar 3D file format, and I can't find any examples on the
> internet.
>
> I have played around with the solid_font.py demo in the
> OpenGLContext/tests/ folder, which uses FontTools to display the text,
> but I don't know how to get that mesh data back out.
It's not really set up to make it easy to get out.  Each glyph that's
created has contour and outline arrays, which are extracted by
ttfquery.glyph.Glyph, but the advances and the like are all done at the
Font level (OpenGLContext.scenegraph.text._fonttools and
OpenGLContext.scenegraph.text.fonttools), without those you'd just have
characters showing up piled on top of each other.  That said, there's
only maybe 1000 lines of code in all three modules, so if you want to
extract the pieces you need you could likely do it in a few hours.  The
obscure stuff is all over in ttfquery, the stuff in OpenGLContext just
takes the contours for each glyph and figures out how to render them
based on a VRML97 font description.

Good luck,
Mike

--
________________________________________________
 Mike C. Fletcher
 Designer, VR Plumber, Coder
 http://www.vrplumber.com
 http://blog.vrplumber.com




--
Dave Morris
http://dave.showviz.net/
http://3dcamphouston.com/