Tk::FontDialog - a font dialog widget for perl/Tk |
Tk::FontDialog - a font dialog widget for perl/Tk
use Tk::FontDialog; $font = $top->FontDialog->Show;
Tk::FontDialog implements a font dialog widget.
In the Family and Size listboxes, the font family and font size can be specified. The checkbuttons on the right turn on bold, italic, underlined and overstriked variants of the chosen font. A sample of the font is shown in the middle area.
With the ``Alt sample'' checkbutton, it is possible to show all characters in the charset instead of the default text. ``Fixed only'' restricts the font family list to fixed fonts only. If the ``Nicefonts'' checkbutton is set, then the font names in the listbox are displayed in the corresponding font. Note that this option can be slow if a lot of fonts are installed or for 16 bit fonts.
A click with the right button in the font size listbox pops up a window to enter arbitrary font sizes.
There are a couple of options to change the labels of the dialog. Note
that you can prepend a tilde (~
) to get an accelerator key with
Alt
. Here is a list of these options with the default (English)
setting:
Note that font names with whitespace like ``New century schoolbook'' or ``MS Sans Serif'' can cause problems when using in a -font option. The solution is to put the names in Tcl-like braces, like
-font => "{New century schoolbook} 10"
- ConfigSpecs handling is poor put at least -font into configspecs - run test, call dialog for 2nd time: immediate change of font? - better name for nicefont - restrict on charsets and encodings (xlsfonts? X11::Protocol::ListFonts?) difficult because core Tk font handling ignores charsets and encodings
Slaven Rezic <slaven@rezic.de>
Suggestions by Michael Houghton <herveus@Radix.Net>.
Copyright (c) 1998,1999,2003 Slaven Rezic. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Tk::FontDialog - a font dialog widget for perl/Tk |