Updated 2015-05-28 15:42:43 by Superlinux

This article shows you a patch that you can add to tkcon so you can change the console font from graphical interface.
--- tkcon        2015-05-28 07:59:21.000000000 +0300
+++ tkcon        2015-05-28 16:42:14.315142143 +0300
@@ -1,7 +1,7 @@
 #!/bin/sh
 # -*- tcl -*-
 # \
-exec "/home/oracle/Downloads/ActiveTcl-8.6/bin/wish8.6" "$0" ${1+"[email protected]"}
+exec "/opt/ActiveTcl-8.6/bin/wish8.6" "$0" ${1+"[email protected]"}
 
 #
 ## tkcon.tcl
@@ -82,6 +82,7 @@
     variable EXPECT 0
 }
 
+
 ## ::tkcon::Init - inits tkcon
 #
 # Calls:        ::tkcon::InitUI
@@ -1604,6 +1605,53 @@
                 -underline 1 -variable ::tkcon::OPT(calcmode)
         $m add check -label "Show Multiple Matches" \
                 -underline 0 -variable ::tkcon::OPT(showmultiple)
+        $m add command -label "Console Font" -command {
+        
+                if { [winfo exists .tkcontop] ==1 } return
+                set fonts_list [tkcon master font families]
+                tkcon master toplevel .tkcontop
+                tkcon master wm title .tkcontop "Console Font"
+                tkcon master wm resizable .tkcontop 0 0
+                tkcon master labelframe .tkcontop.fontname_label -text name
+                tkcon master labelframe .tkcontop.size_label -text size
+                 tkcon master listbox  .tkcontop.fontname_label.fontslist -yscrollcommand [list .tkcontop.fontname_label.yscroll  set ]
+                tkcon master pack .tkcontop.fontname_label -side left -anchor n
+                tkcon master scrollbar .tkcontop.fontname_label.yscroll -command [list  .tkcontop.fontname_label.fontslist  yview ]
+                
+                tkcon master pack .tkcontop.fontname_label.fontslist  -side left
+                tkcon master pack .tkcontop.size_label -side left        -anchor n
+                tkcon master pack .tkcontop.fontname_label.yscroll -side left -anchor e -expand 1 -fill y -after  .tkcontop.fontname_label.fontslist
+                foreach single_font $fonts_list {
+                tkcon master .tkcontop.fontname_label.fontslist insert end $single_font
+                }
+
+                tkcon master entry .tkcontop.size_label.size_entry
+                tkcon master pack .tkcontop.size_label.size_entry 
+                #highlight  the current font name in use in the font names listbox : [lindex [tkcon font] 0 ] ]
+                set current_font_list_index [ lsearch -exact $fonts_list [lindex [tkcon font] 0 ] ]
+                if {  $current_font_list_index == -1 }  { set current_font_list_index 0 }
+                tkcon master      .tkcontop.fontname_label.fontslist see $current_font_list_index
+                tkcon master      .tkcontop.fontname_label.fontslist selection set  $current_font_list_index
+                
+                #get the current font size in use: [lindex [tkcon font] 1 ] ]
+                set  font_size  [ lindex [tkcon font] 1 ] 
+                #tkcon master puts [tkcon font]
+                if { [string length $font_size] ==0  }  { set font_size 8 }
+                tkcon master  .tkcontop.size_label.size_entry  delete 0 end
+                tkcon master  .tkcontop.size_label.size_entry insert 0 $font_size
+                
+                tkcon master button .tkcontop.apply_font_button -text Apply -command  {   
+                     set fontsize [ string trim  [ .tkcontop.size_label.size_entry get ] ]
+                     
+                     
+                     set fontname [ .tkcontop.fontname_label.fontslist get [  .tkcontop.fontname_label.fontslist curselection ] ]
+                     if { [string is integer $fontsize] ==1 && $fontsize >0 }  { 
+                            tkcon font $fontname $fontsize }  else { tkcon font $fontname }
+                     destroy  .tkcontop
+                } 
+                tkcon master pack .tkcontop.apply_font_button -side bottom 
+                
+        }
         if {!$PRIV(AQUA)} {
             $m add check -label "Show Menubar" \
                 -underline 5 -variable ::tkcon::OPT(showmenu) \