title: pygame.error: font not initialized how to fix?
body: <p>So I am having this error pygame.error: font not initialized and I have tired to fix by indenting it, unidentified it, changing the font and other stuff but it still wont work Its at my STARTMENUE. I have
  also tried using another font thinking that was the problem but's not.</p>
  <p>were I am having my problem</p>
  <pre><code>largeText = pygame.font.Font('freesansblod.ttf',115)
  
  </code></pre>
  <p>My full code</p>
  <pre><code>import pygame
  
  #set screen
  window = pygame.display.set_mode((500,500))
  
  #set Name
  pygame.display.set_caption(&quot;Noob&quot;)
  
  
  class Player:
      def __init__(self,x,y,height,width,color):
          self.x = x
          self.y = y
          self.height = height
          self.color = color
          self.speed = 0
          self.isJump = False
          self.JumpCount = 10
          self.fall = 0
          self.rect = pygame.Rect(x,y,height,width)
      def draw(self):
          self.topleft = (self.x,self.y)
  
  class Floor:
      def __init__ (self,x,y,height,width,color):
          self.x = x
          self.y = y
          self.height = height
          self.width = width
          self.color = color
          self.rect = pygame.Rect(x,y,height,width)
      def draw(self):
          self.topleft = (self.x,self.y)
          pygame.draw.rect(window,self.color,self.rect)
  
  
  class Coin():
      def __init__(self,x,y,height,width,color):
          self.x = x
          self.y = y
          self.width = width
          self.height = height
          self.color = color
          self.rect = pygame.Rect(x,y,height,width)
      def draw(self):
          self.topleft = (self.x,self.y)
          self.draw.rect(self.color,self.rect)
      
  
  
  white = (255,255,255)
  
  green = (0,200,0)
  
  red = (255,0,0)
  
  drakred = (200,0,0)
  
  darkgreen = (0,200,0)
  
  black = (0,0,0)
   
  player1 = Player(50,400,40,40,white)
  
  coin = Coin(100,300,30,30,red)
  
  floor1 = Floor(0,400,600,30,green)
  
  
  
  fps = (30)
  
  clock = pygame.time.Clock()
  
  ###########################################
  #START MENUE
  def text_objects(text, font):
      textSurface = font.render(text, True, black)
      return textSurface, textSurface.get_rect()
  
  def button(msg,x,y,w,h,ic,ac,action=None):
      mouse = pygame.mouse.get_pos()
      click = pygame.mouse.get_pressed()
      #print(click)
      if x+w &gt; mouse[0] &gt; x and y+h &gt; mouse[1] &gt; y:
          pygame.draw.rect(window, ac,(x,y,w,h))
  
          if click[0] == 1 and action != None:
              action()         
      else:
          pygame.draw.rect(window, ic,(x,y,w,h))
  
      smallText = pygame.font.SysFont(&quot;comicsansms&quot;,20)
      textSurf, textRect = text_objects(msg, smallText)
      textRect.center = ( (x+(w/2)), (y+(h/2)) )
      window.blit(textSurf, textRect)
  
  def quitgame():
      pygame.quit()
      
  def game_intro():
      
  
      intro = True
  
      while intro:
          for event in pygame.event.get():
              #print(event)
              if event.type == pygame.QUIT:
                  pygame.quit()
                  quit()
  
          
          window.fill((255,255,255))
          largeText = pygame.font.Font('freesansblod.ttf',115)
          TextSurf, TextRect = text_objects(&quot;Jump&quot;, largeText)
          TextRect.center = ((500/2),(500/2))
          window.blit(TextSurf, TextRect)
  
          button(&quot;GO!&quot;,100,350,100,50,green,darkgreen,main_loop)
          button(&quot;Quit!&quot;,300,350,100,50,orange,darkred,quitgame)
  
          pygame.display.update()
          clock.tick(15)
  
  ###############################################
  
  
  
  def main_loop():
      def redrawwindow():
          window.fill((0,0,0))
  
              
          player1.draw()
          coin1.draw()
          floor1.draw()
  
  
          window.blit(text,textRect)
  
          font = pygame.font.Font(&quot;freesansblod.ttf&quot;,30)
          score = 0
          text = (&quot;Coin&quot;+str(score),True,(255,255,255))
          textRect = text.get_rect()
          textRect.center = ((100,40))
  
          run = True
          while run:
              for event in pygame.event.get():
                  if event.type == pygame.QUIT():
                      run = False
  
              for Coin in coin1:
                  for coin1 in range(len(coin)-1-1-1):
                      if player1.rect.colliderect(coin1[one].rect):
                          del coin1[one]
                          score += 1
                          text = pygame.font.Font(&quot;blod.ttf&quot;,30)
                          textRect.center ((100,40))
                              
                          
                          
  
  
  
              key = pygame.key.get_pressed()
                      
              if key[pygame.K_a]:
                  player1.x -= player1.speed
  
              if key[pygame.K_d]:
                  player1.x += player1.speed
  
              if key[pygame.K_w]:
                  player1.y -= player1.speed
              if key[pygame.K_s]:
                  player1.y += player1.speed
  
  
  
          redrawwindow()
          pygame.display.update()
      pygame.quit()
  game_intro()
  main_loop()
                             
  </code></pre>