Skip to content

Commit

Permalink
Font: use the system font only if it is wanted
Browse files Browse the repository at this point in the history
  • Loading branch information
Linkid committed Feb 12, 2018
1 parent dd573ec commit e337db0
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions fofix/core/Font.py
Expand Up @@ -20,9 +20,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, #
# MA 02110-1301, USA. #
#####################################################################
from __future__ import with_statement

import sys
from __future__ import with_statement

from OpenGL.GL import *
import numpy as np
Expand Down Expand Up @@ -80,14 +79,10 @@ def __init__(self, fileName, size, bold=False, italic=False, underline=False, ou
self.aspectRatioFactor = (4.0 / 3.0) / aspectRatio

# Try loading a system font first if one was requested
self.font = None
if systemFont and sys.platform != "win32":
try:
self.font = pygame.font.SysFont(None, size)
except:
pass
if not self.font:
self.font = pygame.font.Font(fileName, size)
if systemFont:
self.font = pygame.font.SysFont(None, size)
else:
self.font = pygame.font.Font(fileName, size)
self.font.set_bold(bold)
self.font.set_italic(italic)
self.font.set_underline(underline)
Expand Down

0 comments on commit e337db0

Please sign in to comment.