简体   繁体   English

如何更改 python 中的文本大小/字体

[英]How do I change the text size / font in python

I've recently been trying to make a basic game, but I cant change the font size of individual words.我最近一直在尝试制作一个基本游戏,但我无法更改单个单词的字体大小。 I managed to do it in tkinter but it made a pop up window and was very clunky.我设法在 tkinter 中做到了,但它弹出了 window 并且非常笨重。 Was wondering if there was a cleaner, easier way to do this.想知道是否有更清洁,更简单的方法来做到这一点。

If you're writing your first game in Python, tkinter probably isn't the best place to start.如果你在 Python 中编写你的第一个游戏,tkinter 可能不是最好的起点。 Unless there's a particular reason to use that, Pygame Zero is designed to make it easy to get started making games and its text drawing lets you set the size easily: https://pygame-zero.readthedocs.io/en/stable/ptext.html除非有特殊原因使用它,否则 Pygame Zero 旨在让您轻松开始制作游戏,其文字绘图可让您轻松设置大小: https://pygame-zero.readthedocs.io/en/stable/ptext .html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM