title: How to scale the font size in pygame based on display resolution?
body: <p><code>largeText = pygame.font.Font('digifaw.ttf',450)</code></p>
  
  <p>Font size is 450 and is suitable for the displaying the text in a full screen display of resolution <code>1366x768</code>. How do I change the font size such that it is compatible with other display resolutions ? I looked up the pydocs for <a href="https://www.pygame.org/docs/ref/font.html#pygame.font.Font.size" rel="nofollow noreferrer">font</a> and couldn't find anything related to auto scaling. </p>
  
  <p><strong>Update:</strong> Here's a snippet of the code</p>
  
  <pre><code>def text_objects(text, font):
      textSurface = font.render(text, True, black)
      return textSurface, textSurface.get_rect()
  
  def message_display(text):
      largeText = pygame.font.Font('digifaw.ttf',450)
      TextSurf, TextRect = text_objects(text, largeText)
      TextRect.center = ((display_width/2),(display_height/2))
      gameDisplay.blit(TextSurf, TextRect)
  
      pygame.display.update()
  
      time.sleep(1)
  
  </code></pre>