V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
woshichuanqilz
V2EX  ›  Python

pygame Linux 如何设置中文?

  •  
  •   woshichuanqilz · 2022-05-20 21:59:19 +08:00 · 1744 次点击
    这是一个创建于 678 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我运行命令: pygame.font.get_fonts(), 拿到了一个字体列表, 找到一个字体: wenquanyimicorhei 应该是支持中文的, 但是然后运行命令,

    说找不到这个文件. FileNotFoundError: [Errno 2] No such file or directory: 'wenquanyimicrohei'

    然后我随便下载了一个中文字体文件, xxx.ttf 文件

    运行命令: pygame.font.Font('xxx.ttf', 72), 运行成功了但是中英文都不显示了. 问下如何解决

    kokutou
        1
    kokutou  
       2022-05-20 23:30:30 +08:00 via Android
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1167 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 18:21 · PVG 02:21 · LAX 11:21 · JFK 14:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.