Re: [PyOpenGL-Users] font rendering problem
Brought to you by:
mcfletch
From: Dirk R. <dir...@gm...> - 2009-05-01 12:53:23
|
Hi Frits, vwf wrote: > Hello PyOpenGL experts, > > > I have an ongoing saga of opengl problems. This time I try to tacle a > font rendering problem. It might be that there are new rendering > techniques available, but I still use a rather old technique. > > The attached image shows the problem, the attached code produces it (on > my system, running Debian Linux, Lenny/stable). For it to run you need > Vera.ttf. The code is a small as I could get it without seriously > changing the functionality. > > Does someone know how to fix it? If there is an entirely new approach, I > would like to know. In 99% of the cases an image like that is caused by images that have odd width. By default OpenGL assumes image lines to start on a 4 byte boundary. if you have RGBA byte-sized pixels that's automatic, but for other sizes it may or may not work. You can try to add a glPixelStore(GL_UNPACK_ALIGNMENT, 1), that would avoid this problem. Hope it helps Dirk |