У меня возникли проблемы с пониманием того, почему следующий код дает опечатку: текст должен быть Unicode или байтами;
def draw_text(self, text, size, color, x, y):
font = pg.font.Font(self.font_name, size)
text_surface = font.render(text, True, color) - error is in this line
text_rect = text_surface.get_rect()
text_rect.midtop = (x, y)
self.screen.blit(text_surface, text_rect)