Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7795221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:00:42+00:00 2026-06-01T23:00:42+00:00

I am trying to recreate my tiny python/pygame project to include multiple languages, and

  • 0

I am trying to recreate my tiny python/pygame project to include multiple languages, and one of the problems I have encountered is the fact that for some reason the accents, tildes etc. are being cropped from the top so only 1 or 2 pixels of them are visible. This applies to most of the ‘accented’ uppercase letters in ie. French, Polish, Spanish, German, etc.
This happens both in python 2.7.2 and python 3.2, using default pygame font.

Trying to render the following string:
‘ÀÂÉÈÊËÎÏÔÙÛÜŸ’

results in the rendered image like this:
French letters

I guess, I am using the standard rendering/blitting technique:

    # -*- coding: utf-8 -*-
    #...
    value = 'ÀÂÉÈÊËÎÏÔÙÛÜŸ'
    if sys.version_info < (3, 0):
        try:
            val = unicode(value, "utf-8")
        except UnicodeDecodeError:
            val = value
        text = font.render("%s" % (val), 1, font_color)
    else:
        val = value
        text = font.render("%s" % (val), 1, font_color)
    self.image.blit(text, (300,300))
    #...

anyone have had this problem before? any workarounds? or is it just that pygame.font.render creates too small surface to accommodate the extra space needed at the top? Maybe some way to set the line height, but I haven’t found that anywhere…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:00:45+00:00Added an answer on June 1, 2026 at 11:00 pm

    Try specifying a font rather than the one youa re using (are you using the default one?) – it is most likely a problem in the font. – It worked for me with all fonts I tried in my system.

    For full games, an ideal solution is distributing the font file alongside your project – since Pygame open fonts given the “.ttf” file name.

    For using a system font, you have to chain calls pygame.font.get_fonts()- to get font names, to pygame.font.match_font to actually get the path to the font file given the font name, and finally pygame.font.Font passing that path and a point-size to get a usable font object (with the render method)

    >>> pygame.font.get_fonts()
    [u'lohitbengali', u'liberationserif', u'dejavuserif', u'wenquanyimicroheimono', u'dejavulgcsans', u'arplumingcn', u'msam10', u'jomolhari', u'esint10', u'cmr10', u'arplumingtwmbe', u'dejavusans', u'lohitgujarati', u'lohitpunjabi', u'arplumingtw', u'arpluminghk', u'dejavusansmono', u'lohitassamese', u'lohitkannada', u'wenquanyimicrohei', u'khmeros', u'waree', u'lohittamil', u'wasy10', u'padauk', u'lohitdevanagari', u'paktypenaqsh', u'abyssinicasil', u'meera', u'eufm10', u'cmex10', u'khmerossystem', u'lklug', u'lohitoriya', u'msbm10', u'liberationsans', u'rsfs10', u'opensymbol', u'cmsy10', u'lohittelugu', u'paktypetehreer', u'cmmi10', u'liberationmono', u'khmeroscontent']
    
    >>> f2 = pygame.font.match_font(u'paktypetehreer')
    >>> f2
    u'/usr/share/fonts/paktype-tehreer/PakType_Tehreer.ttf'
    >>> font = pygame.font.Font(f2, 60)
    >>> f = font.render(u"maçã, joão", 1, (255,255,255))
    >>> scr.blit(f, (200,100))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently learning Python using Zelle's Introductory text, and I'm trying to recreate one
I'm trying to recreate a solution that had multiple projects in it (only the
I'm trying to recreate some SQL queries I have into L2E statements. One of
I'm trying to recreate the feature of Google Maps that changes the map type
I'm trying to recreate a SyndicationFeed object (System.ServiceModel.Syndication) from XML data that has been
So I have been trying to recreate Pong in Box2D to learn how to
I'm trying to recreate an animation (some div sliding) N times, one right after
I am trying to recreate the a section of a UITableView that looks like
I have a Crystal Report I'm trying to recreate from scratch after an update
I am trying to recreate an existing project with Maven (any IDE is ok,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.