PyOpengl text rendering with autocad font

M

Marco

I must use text in Opengl, Python
This text is for architecture design then I need to use AutoCad fonts
(extension .shx).
I have two troubles:

I don't find a guide, a good program, something for use any kind of
fonts in PyOpengl. The nehe tutorial has some bugs in translation to
Python.
I need to scale rotate the text.

I don't know anything about handling fonts, I must use this .shx but I
don't know. In which way can I take this file and put them in my
programs?

In two afternoons in Google I don't find anything.

If somebody wants to help me :)
Thanks.
Marco Bonifazi



http://www.marcobonifazi.com
 
M

Mike C. Fletcher

Marco said:
I must use text in Opengl, Python
This text is for architecture design then I need to use AutoCad fonts
(extension .shx).
I have two troubles:

I don't find a guide, a good program, something for use any kind of
fonts in PyOpengl. The nehe tutorial has some bugs in translation to
Python.
I need to scale rotate the text.
For general font rendering you can choose two major approaches, either
use a built-in platform-Dependant system (such as seen in the NeHe
tutorial) or code your own to render the individual characters using
either one of the cross-platform GUI libraries (2D text) or TTFQuery
(3D/polygonal text (i.e. you can rotate in all 3 dimensions)). There is
a NeHe tutorial translation for the font-rendering demo in
OpenGLContext's tests directory. To render text in general, see the
OpenGLContext/scenegraph/text/* modules. However, none of those knows
how to handle .shx files, they load TTF fonts instead.
I don't know anything about handling fonts, I must use this .shx but I
don't know. In which way can I take this file and put them in my
programs?
If you can find a format specification you may be able to write an
importer (IIRC SHX fonts are just series of lines, so would be very easy
to render once you have the format read). You might find it easier to
redefine the process as "tell autocad to use truetype, then render
truetype" if whoever is asking for .shx will allow it.
If somebody wants to help me :)
Thanks.
HTH,
Mike

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top