include freetype module in Pygame 1.9.2

Issue #75 resolved
Lenard Lindstrom
created an issue

Ready the //freetype// module for Pygame 1.9.2, and build by default.

The main show-stopper was the incorrect calculation of the text size, leading to a segfault in some cases. Also, //freetype.Font// differs from //font.Font//, hindering the adoption of //freetype//.

As of <<changeset 1d5c94df54d5>> the text size problem was resolved. By <<changeset 02f253be9632>> //freetype.Font// could do a passible imitation of font.Font. In progress: add new array struct interface capable //render_raw_to// method, write a drop-in replacement for //pygame.font//.

Comments (17)

  1. Lenard Lindstrom reporter

    Add top level freetype Python modules ( refs #75 )

    Rename the freetype extension module. Add freetype Python module to combine _freetype and sysfont functionality.

    Add ftfont Python module as a freetype drop-in replacement for pygame.font. The module defines Font, a _freetype.Face subclass that emulates class font.Font.


  2. Lenard Lindstrom reporter

    Basic features are in place. Stable Python api. Can emulate pygame.font through the pygame.ftfont wrapper module. Ready for alpha release trials.


    • Polish the documentation.
  3. Jason Marshall

    Will we totally remove SDL_ttf? We still have this code in

    if 'PYGAME_FREETYPE' in os.environ:
            import pygame.ftfont as font
            sys.modules['pygame.font'] = font
        except (ImportError,IOError): pass
        import pygame.font
        import pygame.sysfont
        pygame.font.SysFont = pygame.sysfont.SysFont
        pygame.font.get_fonts = pygame.sysfont.get_fonts
        pygame.font.match_font = pygame.sysfont.match_font
    except (ImportError,IOError):font=MissingModule("font", geterror(), 0)
  4. Log in to comment