Anonymous avatar Anonymous committed 301bc61

merged changes from trunk

Comments (0)

Files changed (176)

-include Setup.in Setup_Darwin.in Setup_Win_Common.in *.py WHATSNEW readme.txt install.html LGPL
+include Setup.in Setup_Darwin.in Setup_Win_Common.in *.py WHATSNEW readme.txt install.html readme.html LGPL
 
 recursive-include docs *
 recursive-include lib *
 check tests:
 	$(PYTHON) run_tests.py
 
+test: build test src
+	$(PYTHON) run_tests.py
+
 docs:	install
 	cd docs/utils
 	$(PYTHON) makedocs.py
 SCRAP = -lX11
 PORTMIDI = -lportmidi
 PORTTIME = -lporttime
+FREETYPE = -lfreetype
+AVFORMAT = -lavformat 
+SWSCALE = -lswscale 
 #--EndConfig
 
-#DEBUG = -C-W -C-Wall
 DEBUG = 
 
 #the following modules are optional. you will want to compile
 _numericsurfarray src/_numericsurfarray.c $(SDL) $(DEBUG)
 _numericsndarray src/_numericsndarray.c $(SDL) $(MIXER) $(DEBUG)
 movie src/movie.c $(SDL) $(SMPEG) $(DEBUG)
+#_movie src/_gsound.c src/_gmovie.c src/_gcommand.c src/gmovie.c $(SDL) $(AVFORMAT) $(SWSCALE) $(MIXER) $(DEBUG)
 scrap src/scrap.c $(SDL) $(SCRAP) $(DEBUG)
-_camera src/_camera.c src/camera_v4l2.c src/camera_v4l.c $(SDL) $(DEBUG)
+#_camera src/_camera.c src/camera_v4l2.c src/camera_v4l.c $(SDL) $(DEBUG)
 pypm src/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
 
 GFX = src/SDL_gfx/SDL_gfxPrimitives.c 
 #GFX = src/SDL_gfx/SDL_gfxBlitFunc.c src/SDL_gfx/SDL_gfxPrimitives.c 
 gfxdraw src/gfxdraw.c $(SDL) $(GFX) $(DEBUG)
 
-
+#optional freetype module (do not break in multiple lines
+#or the configuration script will choke!)
+#freetype src/freetype/ft_cache.c src/freetype/ft_metrics.c src/freetype/ft_wrap.c src/freetype/ft_render.c  src/freetype/ft_render_cb.c src/freetype/ft_text.c src/freetype.c $(SDL) $(FREETYPE) $(DEBUG)
 
 #these modules are required for pygame to run. they only require
 #SDL as a dependency. these should not be altered
 #This file defines platform specific modules for mac os x
 sdlmain_osx src/sdlmain_osx.m $(SDL) $(DEBUG)
+_camera src/_camera.c src/camera_mac.m $(SDL) $(DEBUG)
 # BREAK = change breaks existing code
 # BUG    = fixed a bug that was (or could have been) crashing
 
+[SVN 2573] August 6, 2009
+    [BUG] missing readme.html in MANIFEST.in causes install to fail
+        on pythons with setuptools installed.
+
 [SVN 2519] July 17, 2009
     [BUG] fix pygame.font.get_fonts() bug for Python 3.1 and Windows.
 
         newsetup.write(d.line + '\n')
 
     lines = origsetup.readlines()
-    lines.extend(additional_lines)
+    
+    # overwrite lines which already exist with new ones.
+    new_lines = []
+    for l in lines:
+        addit = 1
+        parts = l.split()
+        for al in additional_lines:
+            aparts = al.split()
+            if aparts and parts:
+                if aparts[0] == parts[0]:
+                    #print ('the same!' + repr(aparts) + repr(parts))
+                    #the same, we should not add the old one.  
+                    #It will be overwritten by the new one.
+                    addit = 0
+        if addit:
+            new_lines.append(l)
+
+    new_lines.extend(additional_lines)
+    lines = new_lines
+
     for line in lines:
         useit = 1
         if not line.startswith('COPYLIB'):
 import os, sys, string
 from glob import glob
 from distutils.sysconfig import get_python_inc
+from config_unix import DependencyProg
 
 class Dependency:
     libext = '.a'
     FrameworkDependency('IMAGE', 'SDL_image.h', 'libSDL_image', 'SDL_image'),
     FrameworkDependency('MIXER', 'SDL_mixer.h', 'libSDL_mixer', 'SDL_mixer'),
     FrameworkDependency('SMPEG', 'smpeg.h', 'libsmpeg', 'smpeg'),
+    FrameworkDependency('PORTTIME', 'CoreMidi.h', 'CoreMidi', 'CoreMidi'),
+    FrameworkDependency('QUICKTIME', 'QuickTime.h', 'QuickTime', 'QuickTime'),
     Dependency('PNG', 'png.h', 'libpng', ['png']),
     Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']),
     Dependency('SCRAP', '','',[]),
     Dependency('PORTMIDI', 'portmidi.h', 'libportmidi', ['portmidi']),
-    FrameworkDependency('PORTTIME', 'CoreMidi.h', 'CoreMidi', 'CoreMidi'),
+    DependencyProg('FREETYPE', 'FREETYPE_CONFIG', '/usr/X11R6/bin/freetype-config', '2.0',
+                   ['freetype'], '--ftversion'),
+    Dependency('AVFORMAT', '','',[]),
+    Dependency('SWSCALE', '','',[]),
 ]
 
 
     global DEPS
 
     print ('Hunting dependencies...')
-    incdirs = ['/usr/local/include','/opt/local/include']
+    incdirs = ['/usr/local/include','/opt/local/include', '/opt/local/include/freetype2/freetype']
     libdirs = ['/usr/local/lib','/opt/local/lib']
     newconfig = []
     for d in DEPS:
         Dependency('JPEG', 'jpeglib.h', 'libjpeg.dll.a'),
         Dependency('PORTMIDI', 'portmidi.h', 'libportmidi.dll.a'),
         Dependency('PORTTIME', 'portmidi.h', 'libportmidi.dll.a'),
+        Dependency('AVFORMAT', 'libavformat/avformat.h', 'libavformat.a'),
+        Dependency('AVCODEC', 'libavcodec/avcodec.h', 'libavcodec.a'),
+        Dependency('AVUTIL', 'libavutil/avutil.h', 'libavutil.a'),
+        Dependency('AVDEVICE', 'libavdevice/avdevice.h', 'libavdevice.a'),
+        Dependency('SWSCALE', 'libswscale/swscale.h', 'libswscale.a'),
         DependencyDLL('TIFF'),
         DependencyDLL('VORBISFILE'),
         DependencyDLL('VORBIS'),
 
 #these get prefixes with '/usr' and '/usr/local' or the $LOCALBASE
 origincdirs = ['/include', '/include/SDL', '/include/SDL',
-               '/include/smpeg' ]
+               '/include/smpeg']
 origlibdirs = ['/lib','/lib64','/X11R6/lib']
 
 def confirm(message):
     return 1
 
 class DependencyProg:
-    def __init__(self, name, envname, exename, minver, defaultlibs):
+    def __init__(self, name, envname, exename, minver, defaultlibs, version_flag="--version"):
         self.name = name
         command = os.environ.get(envname, exename)
         self.lib_dir = ''
         self.libs = []
         self.cflags = ''
         try:
-            config = os.popen(command + ' --version --cflags --libs').readlines()
+            # freetype-config for freetype2 version 2.3.7 on Debian lenny
+            # does not recognize multiple command line options. So execute
+            # 'command' separately for each option.
+            config = (os.popen(command + ' ' + version_flag).readlines() +
+                      os.popen(command + ' --cflags').readlines() +
+                      os.popen(command + ' --libs').readlines())
             flags = ' '.join(config[1:]).split()
 
             # remove this GNU_SOURCE if there... since python has it already,
         else:
             print (self.name + '        '[len(self.name):] + ': not found')
 
+        
+class FFMPEGDependency(Dependency):
+    def __init__(self, name, checkhead, checklib, libs, dirs):
+        self.dirs=dirs
+        Dependency.__init__(self, name, checkhead, checklib, libs)
+        self.cflags=""
+        
+    def configure(self, incdirs, libdirs):
+        incname = self.checkhead
+        libnames = self.checklib, self.name.lower()
+        
+        dirs=self.dirs[:]
+        self.dirs = ["/usr"+d for d in dirs]
+        self.dirs += ["/usr/local"+d for d in dirs]
+        loc_incdirs = incdirs[:]+self.dirs
+        if incname:
+            for dir in loc_incdirs:
+                path = os.path.join(dir, incname)
+                if os.path.isfile(path):
+                    self.inc_dir = dir
+
+        for dir in libdirs:
+            for name in libnames:
+                path = os.path.join(dir, name)
+                if filter(os.path.isfile, glob(path+'*')):
+                    self.lib_dir = dir
+
+        if (incname and self.lib_dir and self.inc_dir) or (not incname and self.lib_dir):
+            print (self.name + '        '[len(self.name):] + ': found')
+            self.found = 1
+        else:
+            print (self.name + '        '[len(self.name):] + ': not found')
+        
+        
 class DependencyPython:
     def __init__(self, name, module, header):
         self.name = name
         Dependency('SCRAP', '', 'libX11', ['X11']),
         Dependency('PORTMIDI', 'portmidi.h', 'libportmidi.so', ['portmidi']),
         Dependency('PORTTIME', 'porttime.h', 'libporttime.so', ['porttime']),
+        FFMPEGDependency('AVFORMAT', 'avformat.h', 'libavformat.a', ['avformat'], ['/include/libavformat', '/include/ffmpeg']),
+        FFMPEGDependency('SWSCALE', 'swscale.h', 'libswscale.a', ['swscale'], ['/include/libswscale', '/include/ffmpeg']),
+        DependencyProg('FREETYPE', 'FREETYPE_CONFIG', 'freetype-config', '2.0', ['freetype'], '--ftversion'),
         #Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL_gfx.so', ['SDL_gfx']),
     ]
     if not DEPS[0].found:
                 print ('Too bad that is a requirement! Hand-fix the "Setup"')
         elif len(self.paths) == 1:
             self.path = self.paths[0]
-            print ("Path for %s:' % self.name")
+            print ("Path for %s:%s" % (self.name, self.path))
         else:
             print ("Select path for %s:" % self.name)
             for i in range(len(self.paths)):
 DEPS.add('PNG', 'png', ['libpng-[1-9].*'], r'(png|libpng13)\.dll$', ['z'])
 DEPS.add('JPEG', 'jpeg', ['jpeg-[6-9]*'], r'(lib){0,1}jpeg\.dll$')
 DEPS.add('PORTMIDI', 'portmidi', ['portmidi'], r'portmidi\.dll$')
+#DEPS.add('FFMPEG', 'libavformat/avformat.h', 'libavformat.a', ['avformat', 'swscale', 'SDL_mixer'], r'avformat-52\.dll')   
+dep = Dependency('FFMPEG', [r'avformat\.dll', r'swscale\.dll', r'SDL_mixer-[1-9].*'], ['avformat', 'swscale', 'SDL_mixer'], required=0)
+DEPS.dependencies.append(dep)
+DEPS.dlls.append(DependencyDLL(r'avformat\.dll', link=dep, libs=['avformat']))
+DEPS.dlls.append(DependencyDLL(r'swscale\.dll', link=dep, libs=['swscale']))
+DEPS.dlls.append(DependencyDLL(r'(lib){0,1}SDL_mixer\.dll$', link=dep, libs=['SDL', 'vorbisfile', 'smpeg']))
 #DEPS.add('PORTTIME', 'porttime', ['porttime'], r'porttime\.dll$')
 DEPS.add_dll(r'(lib){0,1}tiff\.dll$', 'tiff', ['tiff-[3-9].*'], ['jpeg', 'z'])
 DEPS.add_dll(r'(z|zlib1)\.dll$', 'z', ['zlib-[1-9].*'])
     ('SDL', 'SDL', r'SDL\.dll$', []),
     ('PORTMIDI', 'portmidi', r'portmidi\.dll', []),
     ('PORTTIME', 'portmidi', r'portmidi\.dll', []),
+    ('AVCODEC', 'avcodec', r'avcodec\.dll', []),
+    ('AVFORMAT', 'avformat', r'avformat-52\.dll', []),
+    ('AVDEVICE', 'avdevice', r'avdevice-52\.dll', []),
+    ('AVUTIL', 'avutil', r'avutil\.dll', []),
+    ('SWSCALE', 'swscale', r'swscale\.dll', []),
 ]
 
 # regexs: Maps name to DLL file name regex.

docs/ref/camera.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/cdrom.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/color.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/cursors.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/display.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/draw.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/event.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/examples.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/font.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;
   <tt>pygame.font.Font(filename, size): return Font</tt><br>
   <tt>pygame.font.Font(object, size): return Font</tt><br>
 <ul><small><table>
-  <tr><td><a href="font.html#Font.render">Font.render</a> - <font size=-1>draw text on a new Surface</font></td><td>draw text on a new Surface</td></tr>
+  <tr><td><a href="freetype.html#Font.render">Font.render</a> - <font size=-1>Renders text on a surface</font></td><td>draw text on a new Surface</td></tr>
   <tr><td><a href="font.html#Font.size">Font.size</a> - <font size=-1>determine the amount of space needed to render text</font></td><td>determine the amount of space needed to render text</td></tr>
   <tr><td><a href="font.html#Font.set_underline">Font.set_underline</a> - <font size=-1>control if text is rendered with an underline</font></td><td>control if text is rendered with an underline</td></tr>
   <tr><td><a href="font.html#Font.get_underline">Font.get_underline</a> - <font size=-1>check if text will be rendered with an underline</font></td><td>check if text will be rendered with an underline</td></tr>
 <big><b>Font.render</big></b><br><ul>
   <i>draw text on a new Surface</i><br>
   <tt>Font.render(text, antialias, color, background=None): return Surface</tt><br>
-<p>This creates a new Surface with the specified text rendered on it. Pygame provides no way to directly draw text on an existing Surface: instead you must use <tt><a href="font.html#Font.render">Font.render</a> - <font size=-1>draw text on a new Surface</font></tt> to create an image (Surface) of the text, then blit this image onto another Surface. </p>
+<p>This creates a new Surface with the specified text rendered on it. Pygame provides no way to directly draw text on an existing Surface: instead you must use <tt><a href="freetype.html#Font.render">Font.render</a> - <font size=-1>Renders text on a surface</font></tt> to create an image (Surface) of the text, then blit this image onto another Surface. </p>
 <p>The text can only be a single line: newline characters are not rendered. The antialias argument is a boolean: if true the characters will have smooth edges. The color argument is the color of the text <tt>[e.g.:</tt> (0,0,255) for blue]. The optional background argument is a color to use for the text background. If no background is passed the area outside the text will be transparent. </p>
 <p>The Surface returned will be of the dimensions required to hold the text. (the same as those returned by <tt>Font.size())</tt>. If an empty string is passed for the text, a blank surface will be returned that is one pixel wide and the height of the font. </p>
 <p>Depending on the type of background and antialiasing used, this returns different types of Surfaces. For performance reasons, it is good to know what type of image will be used. If antialiasing is not used, the return image will always be an 8bit image with a two color palette. If the background is transparent a colorkey will be set. Antialiased images are rendered to 24-bit <tt>RGB</tt> images. If the background is transparent a pixel alpha will be included. </p>

docs/ref/freetype.html

+
+<html>
+<title>freetype - Pygame Documentation</title>
+<body bgcolor=#aaeebb text=#000000 link=#331111 vlink=#331111>
+
+
+<table cellpadding=0 cellspacing=0 border=0 style='border: 3px solid black;' width='100%'>
+<tr>
+<td bgcolor='#c2fc20' style='padding: 6px;' align=center valign=center><a href='http://www.pygame.org/'><img src='../pygame_tiny.gif' border=0 width=200 height=60></a><br><b>pygame documentation</b></td>
+<td bgcolor='#6aee28' style='border-left: 3px solid black; padding: 6px;' align=center valign=center>
+	||&nbsp;
+	<a href=http://www.pygame.org>Pygame Home</a> &nbsp;||&nbsp;
+	<a href=../index.html>Help Contents</a> &nbsp;||
+	<a href=index.html>Reference Index</a> &nbsp;||
+	<br>&nbsp;<br>
+	
+<a href="camera.html">Camera</a>&nbsp;||&nbsp;
+<a href="cdrom.html">Cdrom</a>&nbsp;||&nbsp;
+<a href="color.html">Color</a>&nbsp;||&nbsp;
+<a href="cursors.html">Cursors</a>&nbsp;||&nbsp;
+<a href="display.html">Display</a>&nbsp;||&nbsp;
+<a href="draw.html">Draw</a>&nbsp;||&nbsp;
+<a href="event.html">Event</a>&nbsp;||&nbsp;
+<a href="examples.html">Examples</a>&nbsp;||&nbsp;
+<a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
+<a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
+<a href="image.html">Image</a>&nbsp;||&nbsp;
+<a href="joystick.html">Joystick</a>&nbsp;||&nbsp;
+<a href="key.html">Key</a>&nbsp;||&nbsp;
+<a href="locals.html">Locals</a>&nbsp;||&nbsp;
+<a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
+<a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
+<a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
+<a href="movie.html">Movie</a>&nbsp;||&nbsp;
+<a href="music.html">Music</a>&nbsp;||&nbsp;
+<a href="overlay.html">Overlay</a>&nbsp;||&nbsp;
+<a href="pixelarray.html">Pixelarray</a>&nbsp;||&nbsp;
+<a href="pygame.html">Pygame</a>&nbsp;||&nbsp;
+<a href="rect.html">Rect</a>&nbsp;||&nbsp;
+<a href="scrap.html">Scrap</a>&nbsp;||&nbsp;
+<a href="sndarray.html">Sndarray</a>&nbsp;||&nbsp;
+<a href="sprite.html">Sprite</a>&nbsp;||&nbsp;
+<a href="surface.html">Surface</a>&nbsp;||&nbsp;
+<a href="surfarray.html">Surfarray</a>&nbsp;||&nbsp;
+<a href="tests.html">Tests</a>&nbsp;||&nbsp;
+<a href="time.html">Time</a>&nbsp;||&nbsp;
+<a href="transform.html">Transform</a>
+</td></tr></table>
+<br>
+
+
+<a name="pygame.freetype">
+<big><b>pygame.freetype</big></b><br><ul>
+  <i>Enhanced Pygame module for loading and rendering fonts</i><br>
+<ul><small><table>
+  <tr><td><a href="freetype.html#pygame.freetype.get_error">pygame.freetype.get_error</a> - <font size=-1>Get the latest error</font></td><td>Get the latest error</td></tr>
+  <tr><td><a href="freetype.html#pygame.freetype.get_version">pygame.freetype.get_version</a> - <font size=-1>Get the FreeType version</font></td><td>Get the FreeType version</td></tr>
+  <tr><td><a href="freetype.html#pygame.freetype.init">pygame.freetype.init</a> - <font size=-1>Initialize the underlying FreeType 2 library.</font></td><td>Initialize the underlying FreeType 2 library.</td></tr>
+  <tr><td><a href="freetype.html#pygame.freetype.quit">pygame.freetype.quit</a> - <font size=-1>Shuts down the underlying FreeType 2 library.</font></td><td>Shuts down the underlying FreeType 2 library.</td></tr>
+  <tr><td><a href="freetype.html#pygame.freetype.was_init">pygame.freetype.was_init</a> - <font size=-1>Returns whether the the FreeType 2 library is initialized.</font></td><td>Returns whether the the FreeType 2 library is initialized.</td></tr>
+  <tr><td><a href="freetype.html#pygame.freetype.Font">pygame.freetype.Font</a> - <font size=-1>Creates a new Font from a supported font file.</font></td><td>Creates a new Font from a supported font file.</td></tr>
+</table></small></ul>
+<p>This module allows for rendering all font formats supported by FreeType, namely <tt>TTF</tt>, Type1, <tt>CFF</tt>, OpenType, <tt>SFNT</tt>, <tt>PCF</tt>, <tt>FNT</tt>, <tt>BDF</tt>, <tt>PFR</tt> and Type42 fonts. </p>
+<p>This module is optional, and replaces all of the functionality of the original 'font' module, whilst expanding it. This module depends in no way on the SDL_ttf library. </p>
+<p>You should test that <tt>pygame.freetype</tt> is initialized before attempting to use the module; if the module is available and loaded, it will be automatically initialized by <tt><a href="pygame.html#pygame.init">pygame.init</a> - <font size=-1>initialize all imported pygame modules</font></tt> </p>
+<p>Most of the work done with fonts is done by using the actual Font objects. The module by itself only has routines to initialize itself and create Font objects with <tt><a href="freetype.html#pygame.freetype.Font">pygame.freetype.Font</a> - <font size=-1>Creates a new Font from a supported font file.</font></tt>. </p>
+<p>You can load fonts from the system by using the <tt>pygame.freetype.SysFont()</tt> function. There are a few other functions to help lookup the system fonts. </p>
+<p>Pygame comes with a builtin default font. This can always be accessed by passing None as the font name to the Font constructor. </p>
+<!--COMMENTS:pygame.freetype--> &nbsp;<br> 
+
+
+<a name="pygame.freetype.get_error">
+<big><b>pygame.freetype.get_error</big></b><br><ul>
+  <i>Get the latest error</i><br>
+  <tt>pygame.freetype.get_error(): return str</tt><br>
+<p>Returns the description of the last error which occurred in the FreeType library, or None if no errors have occurred. </p>
+<!--COMMENTS:pygame.freetype.get_error--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="pygame.freetype.get_version">
+<big><b>pygame.freetype.get_version</big></b><br><ul>
+  <i>Get the FreeType version</i><br>
+  <tt>pygame.freetype.get_version(): return (int, int, int)</tt><br>
+<p>Gets the version of the FreeType2 library which was used to build the 'freetype' module. </p>
+<p>Note that the FreeType module depends on the FreeType 2 library, and will not compile with the original FreeType <tt>1.0</tt>, hence the first element of the tuple will always be 2. </p>
+<!--COMMENTS:pygame.freetype.get_version--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="pygame.freetype.init">
+<big><b>pygame.freetype.init</big></b><br><ul>
+  <i>Initialize the underlying FreeType 2 library.</i><br>
+  <tt>pygame.freetype.init(default_cache_size=64): return None</tt><br>
+<p>This function initializes the underlying FreeType 2 library and must be called before trying to use any of the functionality of the 'freetype' module. </p>
+<p>However, if the module is available, this function will be automatically called by <tt><a href="pygame.html#pygame.init">pygame.init</a> - <font size=-1>initialize all imported pygame modules</font></tt>. It is safe to call this function more than once. </p>
+<p>Optionally, you may specify a default size for the Glyph cache: this is the maximum amount of glyphs that will be cached at any given time by the module. Exceedingly small values will be automatically tuned for performance. </p>
+<!--COMMENTS:pygame.freetype.init--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="pygame.freetype.quit">
+<big><b>pygame.freetype.quit</big></b><br><ul>
+  <i>Shuts down the underlying FreeType 2 library.</i><br>
+  <tt>pygame.freetype.quit(): return None</tt><br>
+<p>This function de-initializes the 'freetype' module. After calling this function, you should not invoke any class, method or function related to the 'freetype' module as they are likely to fail or might give unpredictable results. It is safe to call this function even if the module hasn't been initialized yet. </p>
+<!--COMMENTS:pygame.freetype.quit--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="pygame.freetype.was_init">
+<big><b>pygame.freetype.was_init</big></b><br><ul>
+  <i>Returns whether the the FreeType 2 library is initialized.</i><br>
+  <tt>pygame.freetype.quit(): return bool</tt><br>
+<p>Returns whether the the FreeType 2 library is initialized. </p>
+<!--COMMENTS:pygame.freetype.was_init--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="pygame.freetype.Font">
+<big><b>pygame.freetype.Font</big></b><br><ul>
+  <i>Creates a new Font from a supported font file.</i><br>
+  <tt>pygame.freetype.Font(file, style=STYLE_NONE, ptsize=-1, face_index=0): return Font</tt><br>
+<ul><small><table>
+  <tr><td><a href="freetype.html#Font.name">Font.name</a> - <font size=-1>Gets the name of the font face.</font></td><td>Gets the name of the font face.</td></tr>
+  <tr><td><a href="freetype.html#Font.get_size">Font.get_size</a> - <font size=-1>Gets the size of rendered text</font></td><td>Gets the size of rendered text</td></tr>
+  <tr><td><a href="freetype.html#Font.get_metrics">Font.get_metrics</a> - <font size=-1>Gets glyph metrics for the font's characters</font></td><td>Gets glyph metrics for the font's characters</td></tr>
+  <tr><td><a href="freetype.html#Font.height">Font.height</a> - <font size=-1>Gets the height of the Font</font></td><td>Gets the height of the Font</td></tr>
+  <tr><td><a href="freetype.html#Font.render">Font.render</a> - <font size=-1>Renders text on a surface</font></td><td>Renders text on a surface</td></tr>
+  <tr><td><a href="freetype.html#Font.style">Font.style</a> - <font size=-1>Gets or sets the font's style</font></td><td>Gets or sets the font's style</td></tr>
+  <tr><td><a href="freetype.html#Font.underline">Font.underline</a> - <font size=-1>Gets or sets the font's underline style</font></td><td>Gets or sets the font's underline style</td></tr>
+  <tr><td><a href="freetype.html#Font.bold">Font.bold</a> - <font size=-1>Gets or sets the font's bold style</font></td><td>Gets or sets the font's bold style</td></tr>
+  <tr><td><a href="freetype.html#Font.italic">Font.italic</a> - <font size=-1>Gets or sets the font's italic style</font></td><td>Gets or sets the font's italic style</td></tr>
+  <tr><td><a href="freetype.html#Font.fixed_width">Font.fixed_width</a> - <font size=-1>Gets whether the font is fixed-width</font></td><td>Gets whether the font is fixed-width</td></tr>
+  <tr><td><a href="freetype.html#Font.antialiased">Font.antialiased</a> - <font size=-1>Font antialiasing mode</font></td><td>Font antialiasing mode</td></tr>
+  <tr><td><a href="freetype.html#Font.vertical">Font.vertical</a> - <font size=-1>Font vertical mode</font></td><td>Font vertical mode</td></tr>
+  <tr><td>None</td><td></td></tr>
+</table></small></ul>
+<p>'file' can be either a string representing the font's filename, a file-like object containing the font, or None; in this last case the default, built-in font will be used. </p>
+<p>Optionally, a *ptsize* argument may be specified to set the default size in points which will be used to render the font. Such size can also be specified manually on each method call. Because of the way the caching system works, specifying a default size on the constructor doesn't imply a performance gain over manually passing the size on each function call. </p>
+<p>If the font file has more than one face, the *index* argument may be specified to specify which face index to load. Defaults to 0; font loading will fail if the given index is not contained in the font. </p>
+<p>The 'style' argument will set the default style (italic, underline, bold) used to draw this font. This style may be overriden on any <tt><a href="freetype.html#Font.render">Font.render</a> - <font size=-1>Renders text on a surface</font></tt> call. </p>
+<!--COMMENTS:pygame.freetype.Font--> &nbsp;<br> 
+
+
+<a name="Font.name">
+<big><b>Font.name</big></b><br><ul>
+  <i>Gets the name of the font face.</i><br>
+  <tt>Font.name: return string</tt><br>
+<p>Read only. Returns the real (long) name of the font type face, as specified on the font file. </p>
+<!--COMMENTS:Font.name--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Font.get_size">
+<big><b>Font.get_size</big></b><br><ul>
+  <i>Gets the size of rendered text</i><br>
+  <tt>Font.get_size(text, style=STYLE_DEFAULT, rotation=0, ptsize=default): return (int, int)</tt><br>
+<p>Gets the size in pixels which 'text' will occupy when rendered using this Font. The calculations will take into account the font's default style <tt>(e.g</tt>. underlined fonts take extra height for the underline), or the style may be overridden by the 'style' parameter. </p>
+<p>Returns a tuple containing the width and height of the text's bounding box. </p>
+<p>The calculations are done using the font's default size in points, without any rotation, and taking into account fonts which are set to be drawn vertically via the <tt>Font.vertical</tt> attribute. Optionally you may specify another point size to use via the 'ptsize' argument, or a text rotation via the 'rotation' argument. </p>
+<!--COMMENTS:Font.get_size--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Font.get_metrics">
+<big><b>Font.get_metrics</big></b><br><ul>
+  <i>Gets glyph metrics for the font's characters</i><br>
+  <tt>Font.get_metrics(text, bbmode=BBOX_PIXEL_GRIDFIT, ptsize=default): return [(...), ...]</tt><br>
+<p>Returns the glyph metrics for each character in 'text'. </p>
+<p>The glyph metrics are returned inside a list; each character will be represented as a tuple inside the list with the following values: </p>
+<pre>    (min_x, max_x, min_y, max_y, horizontal_advance)
+</pre><p>By default, these values are returned as grid-fitted pixel coordinates (ints) but one of the following constants may be passed as the bbmode argument to change this: </p>
+<pre>    BBOX_EXACT: Return accurate floating point values.
+    BBOX_EXACT_GRIDFIT: Return accurate floating point values aligned
+    to the drawing grid.
+    BBOX_PIXEL: Return pixel coordinates (ints).
+    BBOX_PIXEL_GRIDFIT (default): Return grid-aligned pixel coordinates.
+</pre><p>The calculations are done using the font's default size in points. Optionally you may specify another point size to use. </p>
+<!--COMMENTS:Font.get_metrics--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Font.height">
+<big><b>Font.height</big></b><br><ul>
+  <i>Gets the height of the Font</i><br>
+  <tt>Font.height: return int</tt><br>
+<p>Read only. Gets the height of the Font. This is the average value of all glyphs in the font. </p>
+<!--COMMENTS:Font.height--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Font.render">
+<big><b>Font.render</big></b><br><ul>
+  <i>Renders text on a surface</i><br>
+  <tt>Font.render(dest, text, fgcolor, bgcolor=None, style=STYLE_DEFAULT, rotation=0, ptsize=default): return (Surface, int, int)</tt><br>
+<p>Renders the string 'text' to a <tt>pygame.Surface</tt>, using the color 'fgcolor'. </p>
+<p>The 'dest' parameter is supposed to be a tuple containing the surface and the coordinates at which the text will be rendered, in that order. </p>
+<p>If such tuple exists, and the destination surface is a valid <tt>pygame.Surface</tt> (independently of its bit depth), the text will be rendered directly on top of it at the passed coordinates, using the given 'fgcolor', and painting the background of the text with the given 'bgcolor', if available. The alpha values for both colors are always taken into account. The width and height of the rendered text will be returned in a tuple. </p>
+<p>If 'None' is passed instead of the destination tuple, a new 32 bit <tt>pygame.Surface</tt> will be created with the required size to contain the drawn text, and using *bgcolor* as its background color. If a background color is not available, the surface will be filled with zero alpha opacity. The width and height of the rendered text, together with the new <tt>:class:`pygame2.sdl.video.Surface`</tt>, will be returned in a tuple. </p>
+<p>The rendering is done using the font's default size in points and its default style, without any rotation, and taking into account fonts which are set to be drawn vertically via the <tt>Font.vertical</tt> attribute. Optionally you may specify another point size to use via the 'ptsize' argument, a text rotation via the 'rotation' argument, or a new text style via the 'style' argument. </p>
+<!--COMMENTS:Font.render--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Font.style">
+<big><b>Font.style</big></b><br><ul>
+  <i>Gets or sets the font's style</i><br>
+  <tt>Font.style: return int</tt><br>
+<p>Gets or sets the default style of the Font. This default style will be used for all text rendering and size calculations unless overriden specifically in the `render()` or `get_size()` calls. The style value may be a bitwise <tt>OR</tt> of one or more of the following constants: </p>
+<pre>    STYLE_NONE
+    STYLE_UNDERLINE
+    STYLE_ITALIC
+    STYLE_BOLD
+</pre><p>These constants may be found on the FreeType constants module. Optionally, the default style can be modified or obtained accessing the individual style attributes (underline, italic, bold). </p>
+<!--COMMENTS:Font.style--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Font.underline">
+<big><b>Font.underline</big></b><br><ul>
+  <i>Gets or sets the font's underline style</i><br>
+  <tt>Font.underline: return bool</tt><br>
+<p>Gets or sets whether the font will be underlined when drawing text. This default style value will be used for all text rendering and size calculations unless overriden specifically in the `render()` or `get_size()` calls, via the 'style' parameter. </p>
+<!--COMMENTS:Font.underline--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Font.bold">
+<big><b>Font.bold</big></b><br><ul>
+  <i>Gets or sets the font's bold style</i><br>
+  <tt>Font.bold: return bool</tt><br>
+<p>Gets or sets whether the font will be bold when drawing text. This default style value will be used for all text rendering and size calculations unless overriden specifically in the `render()` or `get_size()` calls, via the 'style' parameter. </p>
+<!--COMMENTS:Font.bold--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Font.italic">
+<big><b>Font.italic</big></b><br><ul>
+  <i>Gets or sets the font's italic style</i><br>
+  <tt>Font.italic: return bool</tt><br>
+<p>Gets or sets whether the font will be in italics when drawing text. This default style value will be used for all text rendering and size calculations unless overriden specifically in the `render()` or `get_size()` calls, via the 'style' parameter. </p>
+<!--COMMENTS:Font.italic--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Font.fixed_width">
+<big><b>Font.fixed_width</big></b><br><ul>
+  <i>Gets whether the font is fixed-width</i><br>
+  <tt>Font.fixed_width: return bool</tt><br>
+<p>Read only. Returns whether this Font is a fixed-width (bitmap) font. </p>
+<p>Note that scalable fonts whose glyphs are all the same width <tt>(i.e</tt>. monospace <tt>TTF</tt> fonts used for programming) are not considered fixed width. </p>
+<!--COMMENTS:Font.fixed_width--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Font.antialiased">
+<big><b>Font.antialiased</big></b><br><ul>
+  <i>Font antialiasing mode</i><br>
+  <tt>Font.antialiased: return bool</tt><br>
+<p>Gets or sets the font's antialiasing mode. This defaults to True on all fonts, which will be rendered by default antialiased. </p>
+<p>Setting this to true will change all rendering methods to use glyph bitmaps without antialiasing, which supposes a small speed gain and a significant memory gain because of the way glyphs are cached. </p>
+<!--COMMENTS:Font.antialiased--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="Font.vertical">
+<big><b>Font.vertical</big></b><br><ul>
+  <i>Font vertical mode</i><br>
+  <tt>Font.vertical: return bool</tt><br>
+<p>Gets or sets whether the font is a vertical font such as fonts representing Kanji glyphs or other styles of vertical writing. </p>
+<p>Changing this attribute will cause the font to be rendering vertically, and affects all other methods which manage glyphs or text layouts to use vertical metrics accordingly. </p>
+<p>Note that the FreeType library doesn't automatically detect whether a font contains glyphs which are always supposed to be drawn vertically, so this attribute must be set manually by the user. </p>
+<p>Also note that several font formats (specially bitmap based ones) don't contain the necessary metrics to draw glyphs vertically, so drawing in those cases will give unspecified results. </p>
+<!--COMMENTS:Font.vertical--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="">
+<big><b></big></b><br><ul>
+ &nbsp;<br> 
+<!--COMMENTS:--> &nbsp;<br> 
+<br></ul>
+<br></ul>
+<br></ul>
+
+</body></html>

docs/ref/gfxdraw.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/image.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/index.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;
 <li><a href="font.html#Font.get_linesize">Font.get_linesize</a> - <font size=-1>get the line space of the font text</font></li>
 <li><a href="font.html#Font.get_underline">Font.get_underline</a> - <font size=-1>check if text will be rendered with an underline</font></li>
 <li><a href="font.html#Font.metrics">Font.metrics</a> - <font size=-1>Gets the metrics for each character in the pased string.</font></li>
-<li><a href="font.html#Font.render">Font.render</a> - <font size=-1>draw text on a new Surface</font></li>
+<li><a href="freetype.html#Font.render">Font.render</a> - <font size=-1>Renders text on a surface</font></li>
 <li><a href="font.html#Font.set_bold">Font.set_bold</a> - <font size=-1>enable fake rendering of bold text</font></li>
 <li><a href="font.html#Font.set_italic">Font.set_italic</a> - <font size=-1>enable fake rendering of italic text</font></li>
 <li><a href="font.html#Font.set_underline">Font.set_underline</a> - <font size=-1>control if text is rendered with an underline</font></li>
 <li><a href="font.html#pygame.font.match_font">pygame.font.match_font</a> - <font size=-1>find a specific font on the system</font></li>
 <li><a href="font.html#pygame.font.quit">pygame.font.quit</a> - <font size=-1>uninitialize the font module</font></li>
 </ul>
+<li><a href="freetype.html#pygame.freetype">pygame.freetype</a> - <font size=-1>Enhanced Pygame module for loading and rendering fonts</font></li>
+<ul>
+<li><a href="freetype.html#pygame.freetype.Font">pygame.freetype.Font</a> - <font size=-1>Creates a new Font from a supported font file.</font></li>
+<ul>
+<li></li>
+<li><a href="freetype.html#Font.antialiased">Font.antialiased</a> - <font size=-1>Font antialiasing mode</font></li>
+<li><a href="freetype.html#Font.bold">Font.bold</a> - <font size=-1>Gets or sets the font's bold style</font></li>
+<li><a href="freetype.html#Font.fixed_width">Font.fixed_width</a> - <font size=-1>Gets whether the font is fixed-width</font></li>
+<li><a href="freetype.html#Font.get_metrics">Font.get_metrics</a> - <font size=-1>Gets glyph metrics for the font's characters</font></li>
+<li><a href="freetype.html#Font.get_size">Font.get_size</a> - <font size=-1>Gets the size of rendered text</font></li>
+<li><a href="freetype.html#Font.height">Font.height</a> - <font size=-1>Gets the height of the Font</font></li>
+<li><a href="freetype.html#Font.italic">Font.italic</a> - <font size=-1>Gets or sets the font's italic style</font></li>
+<li><a href="freetype.html#Font.name">Font.name</a> - <font size=-1>Gets the name of the font face.</font></li>
+<li><a href="freetype.html#Font.render">Font.render</a> - <font size=-1>Renders text on a surface</font></li>
+<li><a href="freetype.html#Font.style">Font.style</a> - <font size=-1>Gets or sets the font's style</font></li>
+<li><a href="freetype.html#Font.underline">Font.underline</a> - <font size=-1>Gets or sets the font's underline style</font></li>
+<li><a href="freetype.html#Font.vertical">Font.vertical</a> - <font size=-1>Font vertical mode</font></li>
+</ul>
+<li><a href="freetype.html#pygame.freetype.get_error">pygame.freetype.get_error</a> - <font size=-1>Get the latest error</font></li>
+<li><a href="freetype.html#pygame.freetype.get_version">pygame.freetype.get_version</a> - <font size=-1>Get the FreeType version</font></li>
+<li><a href="freetype.html#pygame.freetype.init">pygame.freetype.init</a> - <font size=-1>Initialize the underlying FreeType 2 library.</font></li>
+<li><a href="freetype.html#pygame.freetype.quit">pygame.freetype.quit</a> - <font size=-1>Shuts down the underlying FreeType 2 library.</font></li>
+<li><a href="freetype.html#pygame.freetype.was_init">pygame.freetype.was_init</a> - <font size=-1>Returns whether the the FreeType 2 library is initialized.</font></li>
+</ul>
 <li><a href="pygame.html#pygame.get_error">pygame.get_error</a> - <font size=-1>get the current error message</font></li>
 <li><a href="pygame.html#pygame.get_sdl_byteorder">pygame.get_sdl_byteorder</a> - <font size=-1>get the byte order of SDL</font></li>
 <li><a href="pygame.html#pygame.get_sdl_version">pygame.get_sdl_version</a> - <font size=-1>get the version number of SDL</font></li>

docs/ref/joystick.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/key.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/locals.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/mask.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/midi.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/mixer.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/mouse.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/movie.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/music.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/overlay.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/pixelarray.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/pygame.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/rect.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;
   <i>copy the rectangle</i><br>
   <tt>Rect.copy(): return Rect</tt><br>
 <p>Returns a new rectangle having the same position and size as the orginal. </p>
+<p>New in pygame <tt>1.9</tt> </p>
 <!--COMMENTS:Rect.copy--> &nbsp;<br> 
 <br></ul>
 

docs/ref/scrap.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/sndarray.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/sprite.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/surface.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;
   <i>Shift the surface image in place</i><br>
   <tt>Surface.scroll(dx=0, dy=0): return None</tt><br>
 <p>Move the image by dx pixels right and dy pixels down. dx and dy may be negative for left and up scrolls respectively. Areas of the surface that are not overwritten retain their original pixel values. Scrolling is contained by the Surface clip area. It is safe to have dx and dy values that exceed the surface size. </p>
+<p>New in Pygame <tt>1.9</tt> </p>
 <!--COMMENTS:Surface.scroll--> &nbsp;<br> 
 <br></ul>
 

docs/ref/surfarray.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/tests.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/time.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

docs/ref/transform.html

 <a href="event.html">Event</a>&nbsp;||&nbsp;
 <a href="examples.html">Examples</a>&nbsp;||&nbsp;
 <a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="freetype.html">Freetype</a>&nbsp;||&nbsp;
 <a href="gfxdraw.html">Gfxdraw</a>&nbsp;||&nbsp;
 <a href="image.html">Image</a>&nbsp;||&nbsp;
 <a href="joystick.html">Joystick</a>&nbsp;||&nbsp;

examples/__movie_test.py

+import time 
+import pygame
+pygame.init() #or we could just call pygame.display.init() as thats all we need
+pygame.mixer.quit() #This needs to be done, as the default sound system of the 
+                    # ffmpeg-wrapper uses SDL_mixer, and this would cause major
+                    # conflicts with the mixer module.
+import pygame._movie as movie
+
+print "Please give an (absolute)filename of a movie file you'd like to play: ",
+#filename = raw_input()
+filename="/home/tyler/War3.avi"
+#initialization. It could also have a surface as a second argument, and every 
+# frame will be blitted to that surface. It is the programmer's responsibility
+# to be on time for rendering that surface.
+# Without a surface argument, the ffmpeg-wrapper uses the sdl_overlay library. 
+#screen=pygame.display.set_mode((640, 368))
+
+info = movie.MovieInfo(filename)
+print 
+print info.width, info.height
+print info.filename
+print info.aspect_ratio
+print info.duration
+print info.audio_codec
+print info.video_codec
+
+try:
+    #this is to test that the movie module tests filenames to make sure they exist
+    m=movie.Movie("gsdsjgsdj")
+except Exception, e:
+    print e
+    del m
+
+
+m = movie.Movie(filename)
+print m.paused  #always False, unless .pause has been called
+print m.playing #False until play has been called. Will return to false when
+print m.finished# .stop() has been called.
+                
+print m.width   #default size values of the video file
+print m.height  # They can be modified on the fly, as will be demonstrated.
+
+print m         #calls __repr__, which will show the filename, and the current 
+                # timestamp. 
+#print "repeated looping plays.."#
+#m.play(9)
+#time.sleep(9*130)
+
+surf = pygame.surface.Surface((100, 100))
+#this should cause an error:
+try:
+    m.surface = surf
+except Exception, e:
+    print e
+    del e
+
+print "Playing infinitely"
+
+m.play(-1)       #We're going to use infinite play, so we can demonstrate all 
+                # the features.
+time.sleep(2)  #sleep for ten seconds to let one see the video play, and hear 
+                # the audio
+##print "Paused:",m.paused
+##print "Playing:",m.playing
+##print "Movie:",m
+##print "Y Top:",m.ytop
+##print "X Left:",m.xleft
+time.sleep(10)
+print "Testing seek..."
+m.easy_seek(10, 1, 0, 0)
+time.sleep(5)
+m.easy_seek(10, 0, 0, 0)
+time.sleep(1)
+m.pause()
+time.sleep(5)
+m.pause()
+time.sleep(10)
+
+print "Altering xleft and ytop..."
+m.shift(10, 10)
+time.sleep(10)
+m.shift(0, 0)
+#Now we're going to play with the size of the window, affecting the video on 
+#the fly. resize(width, height) is the main function, changes them both at
+# the same time.
+print "Resizing..."
+m.resize(m.width/2, m.height*2)
+print "sleeping..."
+time.sleep(10) #another ten second nap.
+print "Resizing again..."
+m.width = m.width*4
+print "sleeping again" 
+time.sleep(10)
+print "Back to normal!"
+m.resize(m.width/2, m.height/2)
+print "and again, sleeping..."
+#back to our original size
+time.sleep(10)
+
+
+#Here we demonstrate the use of pause. You pause, then call pause again to play
+print "Pausing..."
+m.pause()
+print "done pausing..."
+print m.paused
+print m.playing
+time.sleep(10)
+print "Unpausing..."
+m.pause()
+print m.paused
+print m.playing
+time.sleep(10)
+#Here is the stop function. Right now, rewind is the exact same as stop.
+print "Stopping..., sleeping for 3 seconds"
+m.stop()
+time.sleep(5)
+#And now we restart playing.
+del m
+print "Playing again..." 
+m=movie.Movie(filename)
+m.play(-1)
+print "done restart play..."
+time.sleep(10)
+import sys
+#sys.exit()
+print "Surface time..."
+m.stop()
+time.sleep(5)
+
+del m
+
+screen = pygame.display.set_mode((info.width, info.height))
+##m.surface=screen
+##time.sleep(1)
+###This will move the movie player from overlay mode to blitting to the surface 
+### we've given it. This means it is our responsibility to update the display on 
+### time.
+###while not m.finished:
+###    time.sleep(0.1)
+###    pygame.display.update()
+##m.stop()
+##time.sleep(5)
+##del m
+
+
+m=movie.Movie(filename, screen)
+counter = 0
+actions = {1: lambda x: x.paused, 6: lambda x:x.pause(), 11: lambda x:x.pause(), 2000:lambda x: x.stop(), 3000: lambda x: x.play(-1)}
+m.play(0)
+prev_time = time.time()
+#m.resize(m.width*2, m.height*2)
+#m.surface = screen
+print "About to do surface gymnastics..."
+##while not m.finished:
+##    time.sleep(0.1)
+##    pygame.display.update()
+##time.sleep(1000)
+while(1):
+    new_time=time.time()
+    diff = int(new_time-prev_time)
+    if(diff>=1):
+        counter+=1
+        print counter
+        prev_time=new_time
+    #print "testing counter"
+    if counter==3100:
+        #print "breaking"
+        break
+    #print "has_key"
+    if actions.has_key(counter):
+        print "Performing action at counter value: %d" % counter
+        actions[counter](m)
+        counter +=1
+    #print "updating"
+    time.sleep(0.1) #we need to let go of the gil occassionally...
+    if(not screen.get_locked()):
+        try:
+            pygame.display.update() #we can do this because we're blitting each frame of the movie to the main screen we instantiated.
+        except pygame.error:
+            break
+        
+print "Ending trial one..."
+m.stop()
+del m
+#the end
+
+m=movie.Movie(filename, screen)
+prev_time = time.time()
+print "About to do surface gymnastics..."
+counter = 0
+while(1):
+    new_time=time.time()
+    diff = int(new_time-prev_time)
+    if(diff>=1):
+        counter+=1
+        print counter
+        prev_time=new_time
+    #print "testing counter"
+    if counter==30:
+        print "breaking"
+        break
+    #print "has_key"
+    if actions.has_key(counter):
+        print "Performing action at counter value: %d" % counter
+        actions[counter](m)
+        counter +=1
+    #print "updating"
+    time.sleep(0.1) #we need to let go of the gil occassionally...
+    if(not screen.get_locked()):
+        try:
+            pygame.display.update() #we can do this because we're blitting each frame of the movie to the main screen we instantiated.
+        except pygame.error:
+            break
+
+del m
+print "the end"

examples/freetype_misc.py

+import sys, os
+import pygame
+from pygame.locals import *
+
+try:
+    import pygame.freetype as freetype
+except ImportError:
+    print ("No FreeType support compiled")
+    sys.exit ()
+
+colors = {
+    "grey_light"    :   pygame.Color(200, 200, 200),
+    "grey_dark"     :   pygame.Color(100, 100, 100),
+    "green"         :   pygame.Color(50, 255, 63),
+    "red"           :   pygame.Color(220, 30, 30),
+    "blue"          :   pygame.Color(50, 75, 245)
+}
+
+def run():
+    pygame.init()
+
+    fontdir = os.path.dirname(os.path.abspath (__file__))
+    font = freetype.Font(os.path.join (fontdir, "sans.ttf"))
+
+    screen = pygame.display.set_mode((800, 600))
+    screen.fill (colors["grey_light"])
+
+    font.render((screen, 32, 32), "Hello World", colors["red"], colors['grey_dark'],
+            ptsize=64, style=freetype.STYLE_UNDERLINE|freetype.STYLE_ITALIC)
+
+    font.render((screen, 32, 128), "abcdefghijklm", colors["grey_dark"], colors["green"],
+            ptsize=64)
+
+    font.vertical = True
+    font.render((screen, 32, 190), "Vertical?", colors["blue"], None, ptsize=32)
+    font.vertical = False
+
+    font.render((screen, 64, 190), "Let's spin!", colors["red"], None,
+            ptsize=48, rotation=55)
+
+    font.render((screen, 150, 270), "All around!", colors["green"], None,
+            ptsize=48, rotation=-55)
+
+    font.render((screen, 250, 220), "and BLEND", pygame.Color(255, 0, 0, 128), None,
+            ptsize=64)
+
+    font.render((screen, 258, 237), "or BLAND!", pygame.Color(0, 0xCC, 28, 128), None,
+            ptsize=64)
+
+    font.render((screen, 298, 320), "I \u2665 Unicode", pygame.Color(0, 0xCC, 0xDD), None,
+            ptsize=64)
+
+    font.render((screen, 480, 32), "\u2665", colors["grey_light"], colors["red"],
+            ptsize=148)
+
+    font.render((screen, 380, 380), "...yes, this is a SDL surface", pygame.Color(0, 0, 0), None,
+            ptsize=24, style=freetype.STYLE_BOLD)
+
+    pygame.display.flip()
+
+    while 1:
+        if pygame.event.wait().type in (QUIT, KEYDOWN, MOUSEBUTTONDOWN):
+            break
+
+    pygame.quit()
+
+if __name__ == "__main__":
+    run ()

Binary file added.

lib/_camera_opencv_highgui.py

 
 class Camera:
 
-    def __init__(self, device =0, size = (640,480), mode = "RGB"):
+    def __init__(self, device = 0, size = (640,480), mode = "RGB"):
         """
         """
         self.camera = highgui.cvCreateCameraCapture(device)

lib/_camera_vidcapture.py

 
 def init():
     global vidcap
-    import vidcap as vc
     vidcap = vc
 
+    try:
+        import vidcap as vc
+    except ImportError:
+        from VideoCapture import vidcap as vc
+
+
 def quit():
     global vidcap
     pass

lib/_dummybackend.py

+"""dummy Movie class if all else fails """
+class Movie:
+    def __init__(self, filename, surface=None):
+        self.filename=filename
+        self.surface = surface
+        self.process = None
+        self.loops=0
+        self.playing = False
+        self.paused  = False
+        self._backend = "DUMMY"
+        self.width=0
+        self.height=0
+        self.finished = 1
+    def play(self, loops=0):
+        self.playing= not self.playing
+        
+    def stop(self):
+        self.playing=not self.playing
+        self.paused =not self.paused
+        
+    def pause(self):
+        self.paused=not self.paused
+        
+    def resize(self, w, h):
+        self.width=w
+        self.height=h
+        
+    def __repr__(self):
+        return "(%s 0.0s)"%self.filename
+    

lib/_vlcbackend.py

+import subprocess, os, time, socket, select
+import threading
+import re
+
+import sys
+if('win' in sys.platform):
+    player="vlc.exe"
+else:
+    player= "vlc"
+remote= "-I rc"
+port = 10000
+hostname = socket.getaddrinfo('localhost', 10000)[0][4][0]
+extra = "--rc-host %s:%d"
+
+class Communicator:
+    def __init__(self, player, remote, extra, port, hostname):
+        self.socket = socket.socket()
+        #print (hostname, port)
+        while 1:
+            try:
+                self.socket.connect((hostname, port))
+                break
+            except socket.error:
+                port+=1
+        self.commands =  ' '.join([player, remote, extra%(hostname, port)])
+        print self.commands
+        self.patterns = {
+            'size'  : re.compile("Resolution: \d{1,4}x\d{1,4}"), 
+            'width' : re.compile("Resolution: \d{1,4}(?=\d{1,4})"), 
+            'height': re.compile("Resolution: (?<=\dx)\d{1,4}|(?<=\d\dx)\d{1,4}|(?<=\d\d\dx)\d{1,4}|(?<=\d\d\d\dx)\d{1,4}"),
+                        }
+    def send(self, message):
+        self.socket.send(message)
+
+    def add(self, filename):
+        self.send("add %s\n" % filename)
+        
+    def enqueue(self, filename):
+        self.send("enqueue %s\n" % filename)
+        
+    def pause(self):
+        self.send("pause\n")
+        
+    def stop(self):
+        self.send("stop\n")
+        
+    def logout(self):
+        self.send("logout\n")
+
+    def info(self):
+        self.send("info\n")
+        d=[]
+        read =[0]
+        while(len(read)>0):
+            read, write, exce = select.select([self.socket], [], [], 0.10)
+            if(len(read)>0):
+                d.append(self.socket.recv(1))
+        d=''.join(d)
+        return d
+        
+    def _get_time(self):
+        self.send("get_time\n")
+        d=[]
+        read =[0]
+        while(len(read)>0):
+            read, write, exce = select.select([self.socket], [], [], 0.10)
+            if(len(read)>0):
+                d.append(self.socket.recv(1))
+        d=''.join(d)
+        d=int(d)#transforms into an int
+        return d
+    
+    def _get_height(self):
+        d=self.info()
+        p = self.patterns['height']
+        m =p.search(d)
+        if not m:
+            return 0
+        return int(m.group())
+
+    def _get_width(self):
+        d=self.info()
+        p= self.patterns['width']
+        m=p.search(d)
+        if not m:
+            return 0
+        return int(m.group())
+
+class Movie(object):
+    """pygame._vlcbackend.Movie:
+        plays a video file via subprocess and the available vlc executable
+    """
+    def __init__(self, filename, surface=None):
+        self.filename=filename
+        self._surface = surface
+        self.process = None
+        self.loops=0
+        self.playing = False
+        self.paused  = False
+        self._backend = "VLC"
+        self.comm = Communicator(player, remote, extra, port, hostname)
+        self.width = 0
+        self.height =0
+        self.finished =0
+    def getSurface(self):
+        #special stuff here
+        return self._surface
+    
+    def setSurface(self, value):
+        #special stuff here, like redirecting movie output here
+        self._surface = value
+    def delSurface(self):
+        del self._surface
+    surface=property(fget=getSurface, fset=setSurface, fdel=delSurface)
+    
+    
+    
+    def play(self, loops=0):
+        self.loops=loops
+        if loops<=-1: self.eternity=1
+        else:         self.eternity=0
+        self.loops -= 1
+        if not self.process:
+            self._play()
+        #otherwise stop playback, and start again with the new loops value.
+        else:
+            self.stop()
+            self._play()
+    def _play(self):
+        comm = self.comm.commands
+        self.process=subprocess.Popen(comm, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+        self.playing = not self.playing
+        self.width = self.comm._get_width()
+        self.height = self.comm._get_height()
+        if(self.eternity):
+            #well, we need to watch vlc, see when it finishes playing, then play the video again, over and over
+            self.comm.add(self.filename)
+            self.t=MovieWatcher(self.comm, 0.1 , self.eternity, self.filename)
+            return
+        #otherwise, we add loops+1 copies of the video to the playlist
+        self.comm.add(self.filename)
+        for i in range(1, self.loops+1):
+            self.comm.enqueue(self.filename)
+        
+        
+    def pause(self):
+        if self.process:
+            #send value to pause playback
+            self.paused = not self.paused
+            self.comm.pause()
+    
+    def stop(self):
+        if self.process:
+            #we kill the process...
+            self.paused = not self.paused
+            self.playing= not self.playing
+            self.comm.stop()
+            self.commd.logout()
+            self.process.terminate()
+            self.process=None
+            self.finished  = 1
+            
+    def __repr__(self):
+        if self.process:
+            return "(%s: %ds)" % (self.filename, self._get_time()) #add on timestamp
+        else:
+            return "(%s: 0.0s)" % self.filename
+    
+    def _get_time(self):
+        if self.process:
+            return self.comm._get_time()
+        
+    
+
+class MovieWatcher(threading.Thread):
+    def __init__(self, comm, time, eternity, filename):
+        threading.Thread.__init__(self)
+        self.comm=comm
+        self.time = time
+        self.eternity = eternity
+        self.filename = filename
+    def run():
+        while(1):        
+            time.sleep(self.time)
+            read, write, exce = select.select([self.comm.socket], [], [], 0.1)
+            d=[]
+            while(len(read)>0):
+                d.append(self.comm.socket.recv(1))
+                read, write, exce = select.select([self.comm.socket], [], [], 0.1)
+            s = ''.join(d)
+            if("status change: ( stop state: 0 )" in s): 
+                if("nothing to play" in s):
+                    self.comm.add(self.filename)
+                    
 
     elif "linux" in sys.platform:
         use__camera = True
-
+    elif "darwin" in sys.platform:
+        use__camera = True
     else:
         use_opencv = True
 
+"""Main newmovie module, imports first from _movie.so, then _vlcbackend if it finds the vlc executable."""
+
+try:
+    from pygame._movie import Movie
+except ImportError:
+    #try to transparently load the _vlcbackend.py Movie object.
+    import os, os.path, sys
+    path=os.path
+    if('win' in sys.platform):
+        if(os.path.exists(path.join(path.join(path.join('C:', 'Program Files'), 'VideoLan'), 'VLC'))):
+            try:
+                from pygame._vlcbackend import Movie, MovieWatcher
+            except ImportError:
+                #you're really hooped now...
+                print "Unable to find a working movie backend. Loading the dummy movie class..."
+                from pygame._dummybackend import Movie
+        else:
+            print "Unable to find a working movie backend. Loading the dummy movie class..."
+            from pygame._dummybackend import Movie
+    else:
+        #POSIX
+        if(os.path.exists(path.join(path.join(path.join(os.sep, 'usr'), 'bin'), 'vlc'))):
+            try:
+                from pygame._vlcbackend import Movie, MovieWatcher
+            except ImportError:
+                #oh man, I didn't mean for this to happen so badly...
+                print "Unable to find a working movie backend. Loading the dummy movie class..."
+                from pygame._dummybackend import Movie
+        else:
+            print "Unable to find a working movie backend. Loading the dummy movie class..."
+            from pygame._dummybackend import Movie
+            
 releases. (hmm, until we get to versions > 10)
 """
 
-ver =   '1.9.0rc3'
-vernum = 1,9,0
+ver =   '1.9.2pre'
+vernum = 1,9,2
         HtmlOut(doc, index, outFile)
         outFile.write(HTMLFinish)
         outFile.close()
- 
-    outFile = open(os.path.join("src", "pygamedocs.h"), "w")
-    outFile.write("/* Auto generated file: with makeref.py .  Docs go in src/ *.doc . */\n")
-    for doc in justDocs:
+
+    for name, doc in docs:
+        outFile = open(os.path.join("src", "doc", "%s_doc.h") % name, "w")
+        outFile.write("/* Auto generated file: with makeref.py .  Docs go in src/ *.doc . */\n")
         WriteDocHeader(outFile, doc, options.have_code_docs)
-
-
-    outFile.write("\n\n/* Docs in a comments... slightly easier to read. */\n\n\n/*")
-    # add the docs as comments to the header file.
-    for doc in justDocs:
+        outFile.write("\n\n/* Docs in a comments... slightly easier to read. */\n\n\n/*")
         WriteDocHeaderComments(outFile, doc)
-
-    outFile.write("\n\n*/\n\n")
-
+        outFile.write("\n\n*/\n\n")
 
     topDoc = LayoutDocs(justDocs)
 
     f.write('\n\n<a name="%s">\n' % doc.fullname)
     f.write("<big><b>%s</big></b><br><ul>\n" % doc.fullname)
     if doc.descr:
-        f.write("  <i>%s</i><br>\n" % doc.descr) 
+        f.write("  <i>%s</i><br>\n" % doc.descr)
     if doc.protos:
         for p in doc.protos:
             f.write("  <tt>%s</tt><br>\n" % p)

msys_build_deps.py

 mingwrt-3.15.1
 win32api-3.12
 mingw32-make-3.81-20080326
-MSYS-1.0.10
+MSYS-1.0.11
 msysDTK-1.0.1
 msys-automake-1.8.2
 msys-autocont-2.59
 IHDR := -I$(pmcom) -I$(pmwin) -I$(pt)
 LIBS := $(LOADLIBES) $(LDLIBS) -lwinmm
 
+
+
 all : $(pmdll)
 .PHONY : all
 
 \tsed 's_#define DEBUG.*$$_/*&*/_' < "$<" > "$@"
 
 $(pmlib) : $(src) $(hdr)
-\t$(CC) $(CPPFLAGS) $(IHDR) -c $(CFLAGS) $(src)
+\tc++ $(CPPFLAGS) $(IHDR) -c $(CFLAGS) $(src)
 \tar rc $(pmlib) $(obj)
 \tranlib $(pmlib)
 
 $(pmdll) : $(pmlib) $(def)
-\t$(CC) -shared $(LDFLAGS) -def $(def) $(pmlib) $(LIBS) -o $@
+\tc++ -shared $(LDFLAGS) -def $(def) $(pmlib) $(LIBS) -o $@
 \tdlltool -D $(pmdll) -d $(def) -l $(pmimplib)
 \tranlib $(pmimplib)
 
   rm -f GNUmakefile portmidi.def
 fi
 """),
-    ]  # End dependencies = [.
+    Dependency('FFMPEG', ['ffmpeg'],
+    ['avformat-52.dll', 'swscale-0.dll', 'SDL_mixer.dll'], """
+
+set -e
+cd $BDWD
+
+if [ x$BDCONF == x1 ]; then
+  ./configure --enable-shared --enable-memalign-hack
+fi
+
+if [ x$BDCOMP == x1 ]; then
+  make
+fi
+
+if [ x$BDINST == x1 ]; then
+  make install
+fi
+
+if [ x$BDSTRIP == x1 ]; then
+  strip --strip-all /usr/local/bin/SDL_ttf.dll
+fi
+
+if [ x$BDINST == x1 ]; then
+  cd libswscale/
+  make
+  make install
+  cd ..
+fi
+
+if [ x$BDCLEAN == x1 ]; then
+  set +e
+  make clean
+fi
+"""),
+
+	
+	]  # End dependencies = [.
 
 
 msys_prep = Preparation('/usr/local', """

prebuilt-template/Setup_Win.in

 OGG = -Iprebuilt/include/ogg -logg
 PORTMIDI = -lportmidi
 PORTTIME =
+AVFORMAT = -Iprebuilt/include -lavformat -lavcodec -lavutil -lws2_32
+SWSCALE = -Iprebuilt/include -lswscale -lavutil
 COPYLIB_SDL -Lprebuilt/lib/SDL.dll
 COPYLIB_SDL_ttf -lSDL -lfreetype -Lprebuilt/lib/SDL_ttf.dll
 COPYLIB_SDL_image -lSDL -ljpef -lpng -ltiff -Lprebuilt/lib/SDL_image.dll
 COPYLIB_vorbis -logg -Lprebuilt/lib/libvorbis-0.dll
 COPYLIB_ogg -Lprebuilt/lib/libogg-0.dll
 COPYLIB_portmidi -Lprebuilt/lib/portmidi.dll
+COPYLIB_avformat -lavcodec -lavutil -Lprebuilt/lib/avformat-52.dll
+COPYLIB_swscale -lavutil -Lprebuilt/lib/swscale-0.dll
+COPYLIB_avcodec -lavutil -Lprebuilt/lib/avcodec-52.dll
+COPYLIB_avutil -Lprebuilt/lib/avutil-50.dll
 
 <font size=+5><b>Pygame Readme</b></font>
 </td></tr><tr><td align=left width=33%><big>
 
-Version 1.9.0rc3
+Version 1.9.2pre
 
 
 </td><td align=center width=34%><big>
 
 
 
-<p><big><b><u>Todo / Ideas</u></b></big> (feel free to submit)<br><ul>
-<li>transform.skew() function</li>
-<li>transform.scroll() function</li>
-<li>image filtering (colors,blurs,etc)</li>
-<li>quake-like console with python interpreter</li>
-<li>game lobby. client, simple server, and protocol</li>
-<li>surfarrays should be able to do RGBA along with RGB</li>
-<li>draw with transparancy</li>
-<li>draw large sets of primitives with a single call</li>
-<li>drawing offsets, perhaps as subsurfaces</li>
-<li>new scale2x, scale3x, and scale4x from hiend3d</li>
-<li>switch Numeric to numarray (see docs on how to do both)</li>
-<li>audio resampling</li>
-</ul></p><br>
+<p><big><b><u>Todo / Ideas</u></b></big> (feel free to submit)<br>
+<a href="http://www.pygame.org/wiki/todo/">http://www.pygame.org/wiki/todo/</a>
+</p><br>
 
 
 
 
    Pygame Readme
-   Version 1.9.0rc3 Python Game Development
+   Version 1.9.2pre Python Game Development
    Originally by Pete Shinners, now an open source community project.
    http://www.pygame.org
    pygame@seul.org
 
 METADATA = {
     "name":             "pygame",
-    "version":          "1.9.0rc3",
+    "version":          "1.9.2pre",
     "license":          "LGPL",
     "url":              "http://www.pygame.org",
     "author":           "Pete Shinners, Rene Dudfield, Marcus von Appen, Bob Pendleton, others...",
 if sys.version_info >= (3, 0, 0):
     python3_skip = ['scrap',
                     '_camera',
+                    '_movie',
                     '_numericsurfarray',
                     '_numericsndarray',
                     ]
               ['test',
                   [['fixtures',
                       [['xbm_cursors',
-                          ['*.xbm']]]]]])
+                          ['*.xbm']],
+                       ['fonts',
+                          ['*.ttf', '*.otf']]]]]])
 
 #examples
 add_datafiles(data_files, 'pygame/examples',
                     if e.sources[i].endswith('scale_mmx.c'):
                         del e.sources[i]
                         return
-    replace_scale_mmx()
+    # linking to 64-bit mingw generated scale_mmx.obj fails
+    if not '64 bit' in sys.version:
+        replace_scale_mmx()
 
 
 #clean up the list of extensions

src/SDL_gfx/SDL_gfxPrimitives.c

 	 */
 	switch (dst->format->BytesPerPixel) {
 	case 1:
-	    memset(pixel, color, dx);
+	    memset(pixel, color, dx+1);
 	    break;
 	case 2:
 	    pixellast = pixel + dx + dx;
 
 #if defined(_WIN32) && !defined(__MINGW_H) && !defined(__SYMBIAN32__)
 
+#ifdef _M_X64
+#include <emmintrin.h>
+static __inline long lrint(float f) {
+    return _mm_cvtss_si32(_mm_load_ss(&f)); 
+}
+#else
 __inline long int