This simple python program can be used to make FontChooser dialog in Tkinter Applications.

Overview

tkFontBox

This simple python program can be used to make FontChooser dialog in Tkinter Applications.

how to use?

  1. Copy the tkFontBox.py file into your current directory .
  2. In your python program, just import it like this.
    from tkFontBox import FontChooser
  3. In your python program of tkinter Application, wherever you want, create a method like this:
def getFont():
    global fc
    try:
        fc.deiconify()
    except Exception as e: #In the first open fontChooser window object have to be created.
        print(e)
        fc = FontChooser(root)#then, will have to open fontChooser again.
    def printFont():
        fn = fc.fontCombo.get()
        fs = fc.fontSizeCombo.get()
        txtbox.config(font=(fn,fs))
        fc.fontCombo.set(fn)
        fc.fontSizeCombo.set(fs)
##            
        fc.withdraw()
    
##        font = fc.getFont()
##        txtbox.config(font=font)
    fc.openFontDialog.config(command=printFont)

Here, getFont() method can be called by any of your TButtons,menus etc. to get the font family name and font size and use them. under printFont() method "fn" is the variable to get font name and "fs" for font size and "txtbox" (in line 20) is the tkinter textBox in which you may want to change the font name and size you selected.

I'm providing 2 files in this repo, 1. font_chooser_main.py 2. tkFontBox.py first file is the example program which is calling tkFontBox to use FontChooser window. Second is the file which is to be used to make FontChooser dialog box in your python programs using tkinter.

Main Window Example Program. image

FontBox Window ScreenShot. image

Affected main Window Text of textbox image

if you liked this repo,and it really helped you, and want to support me to make more repos. like this,
Subscribe our Youtube Channel : CID An Education Hub
~Thanks and Regards,
Pawan Kumar

You might also like...
Json IDE made with Python tkinter!
Json IDE made with Python tkinter!

JIDE Json IDE made with Python tkinter! Download: https://github.com/LouisTheXIV/JIDE/releases/tag/v0.1 Features In JIDE everything is customisable do

A Python Tkinter based Inventory managment System
A Python Tkinter based Inventory managment System

Inventory Management System Using Python Tkinter Introduction Inventory managemrnt system is an open source platform for manage business. It has a com

An offline python frontend for the QuadVisions Colab Notebook using tkinter.
An offline python frontend for the QuadVisions Colab Notebook using tkinter.

Visions GUI An offline python frontend for the QuadVisions Colab Notebook using tkinter. It offers basic options and interactively displays the genera

Signin/Signup GUI form using tkinter in python
Signin/Signup GUI form using tkinter in python

SignIn-SignUpFormRepo Hello there, I am Shahid and this is the Signin/Signup GUI form using tkinter in python if you want to use avatar images then pa

This repository contains some projects that I have done using Python + Tkinter.

This repository contains some projects that I have done using Python + Tkinter.

Bill Cipher is a Python3 Tkinter Application that creates Python remote backdoors, while giving you the option to convert it to an exe.

Bill Cipher is a Python3 Tkinter Application that creates Python remote backdoors, while giving you the option to convert it to an exe. The program also configures a .py server file that works with the backdoor

A GUI calculator made with tkinter module in python
A GUI calculator made with tkinter module in python

GUI-Calculator A GUI calculator made with tkinter module in python How to setup the calculator If pygame is not installed, go to terminal and do pip i

Python script with tkinter that allows you to open a local chat room

Server_chat Python script with tkinter that allows you to open a local chat room To begn you'll have to start the server side script and run it. You w

A calculator made using Python and Tkinter

Abacus Abacus is a calculator used to compute expressions with the operators of Addition, Subtraction, Multiplication and Division. It is named after

Owner
Pawan Kumar Prachi
Being the one ,You desire.
Pawan Kumar Prachi
Tkinter-ATM - Python GUI case made with Tkinter

tkinter-ATM Python GUI case made with Tkinter The task of this case was to creat

null 2 Jan 13, 2022
Tkinter calculetor - Tkinter calculetor with python

Tkinter_calculetor required to run py file pip install tkinter

Yasir Arafat 0 Feb 7, 2022
Tkinter Designer - Create Beautiful Tkinter GUIs by Drag and Drop.

Tkinter Designer is created to speed up and beautify Python GUI Experience. It uses well know design software called Figma. Which makes creating Tkinter GUI in Python a piece of cake.

Parth Jadhav 5.2k Jan 9, 2023
Weather-API-GUI-Tkinter - A weather tool made using tkinter which works by fetching query city weather using an API

Weather-API-GUI-Tkinter ☁️ ❄️ version- 1️⃣ . 0️⃣ . 0️⃣ This repo contains a weat

SasiVatsal 4 Jul 8, 2022
Make desktop applications using HTML and CSS with python

Neutron Make desktop applications using HTML and CSS with python What is Neutron Neutron will allow developers to design modern applications in python

Ian Baldelli 284 Dec 29, 2022
A simple GUI designer for the python tkinter module

Leer en Español Welcome to Pygubu! Pygubu is a RAD tool to enable quick and easy development of user interfaces for the Python's tkinter module. The u

Alejandro Autalán 1.7k Dec 27, 2022
LyricsGenerator - A simple GUI made using Python(Tkinter) for generating song lyrics

Lyrics Generator Reference :- https://www.geeksforgeeks.org/create-a-gui-to-extr

Somya Ranjan Sahu 3 Mar 25, 2022
🧮A simple calculator written in python allows you to make simple calculations, write charts, calculate the dates, and exchange currency.

Calculator ?? A simple calculator written in python allows you to make simple calculations, write charts, calculate the dates, and exchange currency.

Jan Kupczyk 1 Jan 15, 2022
My Git GUI version made in Python and Tkinter.

Description My Git GUI version made in Python and Tkinter. How to use Basically, create a folder in your computer, open the software, select the path

Matheus Golzio 4 Oct 10, 2021