PDA

View Full Version : Stroked Fonts?



chennes
02-19-2001, 10:17 AM
Is there a way to create stroked fonts similar to wglUseOutlineFonts() (or whatever it's called...) in Linux? GLUT doesn't have enough fonts to be really useful, and I don't really want to write them from scratch http://www.opengl.org/discussion_boards/ubb/smile.gif.

Chris

rts
02-19-2001, 12:02 PM
I don't know if this will do what you want, but there is a "glXUseXFont" function you may want to look at. Check out "man glXUseXFont" to see if it is indeed what you need.



Originally posted by chennes:
Is there a way to create stroked fonts similar to wglUseOutlineFonts() (or whatever it's called...) in Linux? GLUT doesn't have enough fonts to be really useful, and I don't really want to write them from scratch http://www.opengl.org/discussion_boards/ubb/smile.gif.

Chris

elp99jcm
02-20-2001, 03:23 AM
Hi, I've just been playing around with using fonts through opengl under Linux. If you look at the Nehe tutorial 13 (http://nehe.gamedev.net/opengl.asp) and scroll down you'll find an implementation of bitmapped fonts using Linux.

There are actually two versions, one using Glut and the other using the X API through GLX. These will show you how to create the fonts. The GLUT version opens a separate connection to the X server and loads the fonts into a display list using glXUseXFont and the GLX version does the same thing but uses the current connection to the X server. I can't get the Glut version to work, and I would be interested to know if you can. The GLX version works fine and I am using that at the moment but, unfortunately, if means you have to add a lot of code which glut usually takes care of.

If you need to rotate the text then I'm not sure how you do this. Using the above tutorials makes the fonts always face forward (you can rotate them in 2D and scale them). This is ideal for me because I am using the text to label 3D structures.

Hope this helps.

James

chennes
02-20-2001, 05:38 AM
No! Not bitmapped fonts, stroked fonts!

I am currently using bitmapped fonts via glxUseXFont(), but then when I need to print, I have to do some crazy stuff to get them into postscript. If I could just get the font descriptions into OpenGL, I wouldn't have to use the PS stuff anymore (it's *really* ugly).

Chris