From 071315a7089435a43c9d1f29ecb534e41c122665 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 3 Sep 2017 18:20:49 +0000 Subject: Fix [8277e1a906]: fontchooser is out of sync with dynamically loaded fonts. Patch from Aldo Buratti. --- library/fontchooser.tcl | 1 + 1 file changed, 1 insertion(+) diff --git a/library/fontchooser.tcl b/library/fontchooser.tcl index 8f91ade..14ac650 100644 --- a/library/fontchooser.tcl +++ b/library/fontchooser.tcl @@ -65,6 +65,7 @@ proc ::tk::fontchooser::Show {} { wm transient $S(W) [winfo toplevel $S(-parent)] tk::PlaceWindow $S(W) widget $S(-parent) } + set S(fonts) [lsort -dictionary [font families]] wm deiconify $S(W) } -- cgit v0.12 From e0f48e9a758dd7144dabbb437aeddb50b0e5af3f Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 13 Sep 2017 21:07:39 +0000 Subject: Fix the proposed patch since it had unexpected jumping effects in the fonts listbox. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For instance in wish (the extrafont package is supposed to have been installed): tk fontchooser show ; # shows existing fonts package require extrafont extrafont::load /home/francois/Téléchargements/Term-RegCcc.ttf tk fontchooser show ; # check that the new font family "Term" is now available in the listbox # click on a font family _before_ "Term" -> fine # click on a font family _after_ "Term" -> the font listbox jumped to the top of the list! --- library/fontchooser.tcl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/fontchooser.tcl b/library/fontchooser.tcl index 14ac650..5395acb 100644 --- a/library/fontchooser.tcl +++ b/library/fontchooser.tcl @@ -66,6 +66,8 @@ proc ::tk::fontchooser::Show {} { tk::PlaceWindow $S(W) widget $S(-parent) } set S(fonts) [lsort -dictionary [font families]] + set S(fonts,lcase) {} + foreach font $S(fonts) { lappend S(fonts,lcase) [string tolower $font]} wm deiconify $S(W) } -- cgit v0.12