Lenard Lindstrom avatar Lenard Lindstrom committed bfea702

Make pygame.freetype.SysFont usable

The pygame.sysfont module was not imported. The SysFont function was broken.

Comments (0)

Files changed (1)

 """Enhanced Pygame module for loading and rendering font faces"""
 
 from pygame._freetype import *
+from pygame.sysfont import match_font, get_fonts, SysFont as _SysFont
 
 def SysFont(name, size, bold=0, italic=0, constructor=None):
     """pygame.ftfont.SysFont(name, size, bold=False, italic=False, constructor=None) -> Font
 
        if optional contructor is provided, it must be a function with
        signature constructor(fontpath, size, bold, italic) which returns
-       a Font instance. If None, a pygame.ftfont.Font object is created.
+       a Font instance. If None, a pygame.freetype.Face object is created.
     """
     if constructor is None:
         def constructor(fontpath, size, bold, italic):
-            font = Face(fontpath, size)
-            font.bold = bold
-            font.oblique = italic
-            return font
+            return Face(fontpath, size)
 
     return _SysFont(name, size, bold, italic, constructor)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.