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

Owner
Pawan Kumar Prachi
Being the one ,You desire.
Pawan Kumar Prachi
A desktop application developed in Python with PyQt5 to predict demand and help monitor and schedule brewing processes for Barnaby's Brewhouse.

brewhouse-management A desktop application developed in Python with PyQt5 to predict demand and help monitor and schedule brewing processes for Barnab

Isaac Cheng 2 Jul 09, 2022
Text to Binary Converter

Text to Binary Converter Programmed in Python | PySimpleGUI If you like it give it a star How it works Simple text to binary and binary to text conver

Adrijan 11 Dec 06, 2022
A GUI frontend developed in Python3 for simple admin tasks on MySQL-Server running on the localhost

A GUI frontend developed in Python3 for simple admin tasks on MySQL-Server running on the localhost. Developed for my CS School Project.

1 May 29, 2022
ZFS Administration GUI

ZYGGY ZFS Administration GUI Zyggy is a very simple GUI for basic ZFS administration. The system provides graphical access for most frequently used ZF

51 Dec 18, 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
Basic calculator using Tkinter GUI

Basic calculator using Tkinter GUI

Rogerio Penchel 17 Jan 09, 2022
A Simple GUI application to organize and store accounts/passwords.

PyssView A Simple GUI application to organize and store accounts/passwords. Install/Run (Linux) Via script This way will install a binary version and

Jefferson Richard Dias 1 Nov 24, 2021
PyEditor - A Simple Text Editor for python

PyEditor work in progress Text Editor for python Installation git clone https://github.com/ArmenG888/PyEditor Install the libraries Linux or mac pip

ArmenG 3 Mar 15, 2022
OpenPort scanner GUI tool (CNMAP)

CNMAP-GUI- OpenPort scanner GUI tool (CNMAP) as you know it is the advanced tool to find open port, firewalls and we also added here heartbleed scanni

9 Mar 05, 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
Chatterpatter - A simple GUI complex backend Chat Application made using python

Chatterpatter - A simple GUI complex backend Chat Application made using python

Gurneet Singh 2 Jan 08, 2022
Simple GUI python app to show a stocks graph performance. Made with Matplotlib and Tiingo.

stock-graph-python Simple GUI python app to show a stocks graph performance. Made with Matplotlib and Tiingo. Tiingo API Key You will need to add your

Toby 12 May 14, 2022
GUI Python Auto text bot.

Bagel Text Bot Auto text bot. Written in Python. Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what

Toby 3 May 14, 2022
TextTUI is a set of extensions to the Textual and Textual-Inputs libraries

TextTUI is a set of extensions to the Textual and Textual-Inputs libraries. Currently a Work in Progress that is based on the 0.1.14 branch of

3 Feb 10, 2022
Randomly picks between your favourite meals for you when you're feeling indecisive.

Food Recommendations Desktop application created with python and tkinter. The goal for this application is to provide a way for users to enter and sav

Jesse Kartabani 1 Dec 07, 2021
A Virtual Desktop Assistant Written in Python

DesktopAssitant A Virtual Desktop Assistant Written in Python. It's generally a basic virtual assistant The basic purpose of this is to make work easi

Technerd brainiac 609 Jan 07, 2023
Software com funçoes de A a Z feito no Python

Introdução Iniciante em programação Python, decidi criar um programa com diversas ferramentas de A a Z. Funções Ferramenta de Gerenciamento e Manutenç

João Pedro 1 Jan 26, 2022
Tkinter calculetor - Tkinter calculetor with python

Tkinter_calculetor required to run py file pip install tkinter

Yasir Arafat 0 Feb 07, 2022
AppQuickLauncher is a tool that can quickly launch apps by clicking the app tray icon.

AppQuickLauncher AppQuickLauncher is a tool that can quickly launch apps by clicking the app tray icon. On Windows 7 or Windows 10, we can add a folde

yin kaisheng 2 Sep 11, 2022
Nonton anime subtitle Indonesia tanpa iklan. Dengan GUI berbasis PyQt5 dan spaghetti code yang sangat tidak terstruktur

Nonton anime subtitle Indonesia tanpa iklan. Dengan GUI berbasis PyQt5 dan spaghetti code yang sangat tidak terstruktur

Ayra Hikari 21 Dec 18, 2022