1. pygame
  2. pygame
  3. pygame
  4. Issues

Issues

Issue #75 resolved

include freetype module in Pygame 1.9.2

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 (16)

  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.

    47f0f62d053c

  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.

    TODO

    • Polish the documentation.
  3. Jason Marshall

    Will we totally remove SDL_ttf? We still have this code in init.py:

    if 'PYGAME_FREETYPE' in os.environ:
        try:
            import pygame.ftfont as font
            sys.modules['pygame.font'] = font
        except (ImportError,IOError): pass
    try:
        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