title: Pygame: Centering text system font text
body: <p><strong>I have read this post about centering text:</strong>
  <a href="https://stackoverflow.com/questions/23982907/python-library-pygame-centering-text">Pygame - How to Center Text</a></p>
  <p>However instead of importing text from a file:</p>
  <p><code>font = pygame.font.Font(&quot;example_font.tff&quot;, 25)</code></p>
  <p>I want to use a font from the users system</p>
  <p><code>font = pygame.freetype.SysFont(&quot;comicsansms&quot;, 0)   </code></p>
  <p>using the freetype module as I think it makes rendering to various sizes easier (like when the user resizes the window)<br />
  <code>font.render_to(surface, pos, ..., size=int(surface.get_height()/2))</code></p>
  <p>Im not sure how to set a value for pos where the text will be shown in the center of the surface, as I can't <code>.get_rect()</code> or anything to get the dimensions of the text</p>
  <p><strong>Possible solutions?</strong><br />
  Getting the dimensions of the text<br />
  Using System Fonts with <code>pygame.font.Font()</code></p>
  <p>Thanks!</p>