This article is deprecated. Please go to this article for a better solution. Add "Console Font" menu item in "Prefs" menu of tkcon
Hi.
I know many finds it hard to change tkcon console font the first time they use it if they are not told that tkcon has command line options. One of the options is the -font .
Today, I edited the script of tkcon.tcl to let it use the command tk fontchooser . The tk fontchooser helps you choose the font you like for the widget/window path you want.
You can also watch this youtube that explains the steps below.
https://www.youtube.com/watch?v=3DqEIep8YQM
So, this is what you should do:
proc ::tkcon::fontchooserFontSelection {w font args} { $w configure -font [font actual $font] }
$m add command -label "Console Font" -command { tk fontchooser show tk fontchooser configure -font [ $::tkcon::PRIV(console) cget -font ] \ -command [list ::tkcon::fontchooserFontSelection $::tkcon::PRIV(console)] }
RLE (2014-08-04): A "diff -u" between the original and your modified tkcon file would also be useful to post. The diff has two advantages:
Superlinux - 2014-08-08 16:40:23
OK! thanks. let's say you copied the original tkcon to the new name tkcon.original, then diff -u tkcon.original tkcon gives this result:
--- tkcon.original 2014-08-08 19:19:25.921739806 +0300 +++ tkcon 2014-08-04 12:11:33.123918860 +0300 @@ -82,6 +82,10 @@ variable EXPECT 0 } +proc ::tkcon::fontchooserFontSelection {w font args} { + + $w configure -font [font actual $font] +} ## ::tkcon::Init - inits tkcon # # Calls: ::tkcon::InitUI @@ -1606,6 +1610,11 @@ -underline 1 -variable ::tkcon::OPT(calcmode) + $m add command -label "Console Font" -command { + tk fontchooser show + tk fontchooser configure -font [ $::tkcon::PRIV(console) cget -font ] \ + -command [list ::tkcon::fontchooserFontSelection $::tkcon::PRIV(console)] + } if {!$PRIV(AQUA)} { $m add check -label "Show Menubar" \
ak - 2014-09-05 20:49:08
Jeff (author of Tkcon) tells me that the patch is not quite correct. He said that it should use the tkcon font command as that carries the value across console windows, and that he is using Tk fonts.