pygame的中文显示处理着总觉得还不是最终的方案,这太简陋了,而且mac和windows本的处理方法还不一样,目前找到这个方法似乎是可以兼容两个平台的(当然,字体目录要一致)

    def _DrawText(self, _text, _size, _pos, _color):
        # 显示文字
        fontobj = pg.font.Font('/System/Library/Fonts/Supplemental/Songti.ttc', _size)
        textobj = fontobj.render(_text, True, _color)
        textobjrect = textobj.get_rect()
        if _pos[0] >= 0:
            textobjrect.x = _pos[0]
        elif _pos[0] == -1:
            textobjrect.x = (SCREEN_RECT.width - textobjrect.width) // 2

        if _pos[1] >= 0:
            textobjrect.y = _pos[1]
        elif _pos[1] == -1:
            textobjrect.y = (SCREEN_RECT.height - textobjrect.height) // 2

        self.screen.blit(textobj, textobjrect)

具体调用示例

self._DrawText('干的不错,再接再厉!', 36, [-1, 260], (0, 0, 0))