File: fonts.py

package info (click to toggle)
pyopengl 3.0.0~b6-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 5,696 kB
  • ctags: 26,182
  • sloc: python: 34,233; ansic: 70; sh: 26; makefile: 15
file content (25 lines) | stat: -rw-r--r-- 631 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Load font "constants" (actually void *s) from the GLUT DLL"""
from OpenGL import platform

for name in [
	'GLUT_STROKE_ROMAN',
	'GLUT_STROKE_MONO_ROMAN',
	'GLUT_BITMAP_9_BY_15',
	'GLUT_BITMAP_8_BY_13',
	'GLUT_BITMAP_TIMES_ROMAN_10',
	'GLUT_BITMAP_TIMES_ROMAN_24',
	'GLUT_BITMAP_HELVETICA_10',
	'GLUT_BITMAP_HELVETICA_12',
	'GLUT_BITMAP_HELVETICA_18',
]:
	try:
		# Win32 just has pointers to values 1,2,3,etc
		# GLX has pointers to font structures...
		p = platform.getGLUTFontPointer( name )
	except (ValueError,AttributeError), err:
		print 'GLUT font error', str(err)
	else:
		globals()[name] = p
		del p

del platform, name