Typy Chooser

Difference between version 1 and 0 - Previous - Next
[LES] on March 12 2024: I was looking for a font selection dialog and wasn't overly pleased by the existing offerings. By the number of [Font Choosers] in the wiki, it seems I am not the only one. Tk 8.6 includes a built-in fontchooser which doesn't just return the selection in the most simple possible way and like so many things in IT, I think it looks bad because of very small fonts. A font chooser is easy to make so I made my own. It's provided as a package:

===
 package require typychooser
===

Where: https://sourceforge.net/projects/typychooser/files/

[https://a.fsdn.com/con/app/proj/typychooser/screenshots/typychoosergui-81bbca20.png/max/max/1]
===
 Typy Chooser 1.0
 
 NAME
 
 Typy Chooser- a font selection dialog 
 
 SYNOPSIS
 
 typychooser ?-option value -option value ...?
 
 DESCRIPTION
 
 Typy Chooser is a font selection dialog for use in Tk-based applications. It always returns the selection as a list of three elements: font face, font size and font style.
 
 CONFIGURATION OPTIONS
 
 -title 
 
 Specifies the title of the dialog. The default string is "Typy Chooser". Has no effect on platforms where the font selection dialog does not support titles.
 
 -guifont
 
 Specifies the font to be used in the dialog itself. The default option is "Freesans 14". This option must be a list of two elements, font face and font size. If the font face name has spaces, it must be properly isolated from the size, e.g. {"Times New Roman" 14}.
 
 -sampletext
 
 Specifies the text/string to be used in the sample area of the dialog.
 
 -nosize
 
 Specifies that the choice of font size will not be available in the dialog. It will be hidden. Note that dialog still returns a list of three elements: font face, font size and font style. In this case though, the font size is returned as 0 (zero).
 
 -nostyle
 
 Specifies that the choice of font style will not be available in the dialog. It will be hidden. Note that dialog still returns a list of three elements: font face, font size and font style. In this case though, the font style is returned as "normal".
 
 KEY BINDINGS
 
 The Tab key moves the focus around so everything may be selected from the keyboard, without the mouse.
 
 The up and down arrow keys move the selection along the lists of font face, font size and font style.
 
 The plus (+) and minus (-) keys, both on the top number row and the numeric pad of the keyboard, control the size of the fonts in the dialog's GUI. That control is only temporary. Its changes are not kep across sessions.
 
 The sample text area is a regular text widget and carries all the default key bindings of the Tk text widget.
 
 KEYWORDS
 
 fonts
===