- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to increase the font size of a Text widget?
We can customize the Tkinter widget by modifying the value of its properties such as font-family, text-size, text-size, width, the height of the frame, etc. Tkinter Text widgets are generally used for accepting multiline user input. It is similar to a standard text widget.
To configure the text properties of the a widget, we can use the font(‘font-family font-size font-style) attribute by defining its font-family, font-size, and the font style.
Example
#Import tkinter library from tkinter import * #Create an instance of Tkinter frame or window win= Tk() #Set the geometry of tkinter frame win.geometry("750x250") #Create a Text widget text= Text(win, width= 60, height= 10, font=('Century Schoolbook', 20, 'italic')) text.insert(INSERT, "Hello\nWelcome to TutorialsPoint.com!") text.pack() win.mainloop()
Output
Executing the above code will display a text editor which has the customized font attributes.
Now, change the font attributes properties to see the reflected changes.
Advertisements
To Continue Learning Please Login
Login with Google