简体   繁体   English

如何更改 tkinter 中的字体大小

[英]How do you change font size in tkinter

So I am trying to change the font size of a label I have in tkinter, but no-matter what I try I don't get the result I am looking for.所以我正在尝试更改我在 tkinter 中的 label 的字体大小,但无论我尝试什么,我都没有得到我想要的结果。 I have tried font=("Arial", 20) and size=fontsize+2 .我试过font=("Arial", 20)size=fontsize+2 But none of them really work well.但它们都没有真正运作良好。 Does anyone know what I should use?有谁知道我应该使用什么?

you want to change the size of font then try你想改变字体的大小然后尝试

label.config(font=("Arial", 20))

If you want to change width如果你想改变宽度

label.config(width=200)

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

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