Message263210
#24745 changed the default fixed font from Courier to TkFixedFontin 3.5.0, 3.4.4, and 2.7.11 when using tcl/tk 8.5+. On some OSes, the latter is not Courier and looks much better. I don't know why the two behave differently on some systems.
Since this is not a unique problem on one machine, I am reopening this to at least provide a workaround. Regardless of ultimate cause, we can at least force a blank font size to a default int string, such as '10'. I closed #24951 as a duplicate of this.
In class idlelib.configDialog.ConfigDialog, method CreatePageFontTab (line 114) creates StringVar self.fontSize, initialized to ''. The Var is passed to class dynOptionMenuWidget.DynOptionMenu(tkinter.OptionMenu). The instance is bound to self.optMenuFontSize. Method LoadFontCfg (line 963) sets retrieves the current Editor font as local name configeredFont and local fontSize therefrom. It passes fontSize to self.optMenuFontSize.SetMenu. This in turns sets the stored self.fontSize to the passed in fontSize, overwriting the initial value.
(The OptionMenu.__init__ docstring and http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/optionmenu.html suggest that the variable must be a StringVar, which I presume is why self.fontSize is. Experiment suggest otherwise in 8.6. This would have to be verified on 8.5 and even 8.4 before changing to IntVar.)
If my understanding based on the above, fontSize must be set to '' when the current font is TkFixedFont, but not when the font is Courier. Petr, could you confirm by adding "print(configuredFont, fontsize)" to LoadFontCfg after both names are set and running both buggy and good cases? |
|
Date |
User |
Action |
Args |
2016-04-11 21:47:39 | terry.reedy | set | recipients:
+ terry.reedy, kbk, gpolo, roger.serwy, petr.viktorin, serhiy.storchaka, wysaard |
2016-04-11 21:47:39 | terry.reedy | set | messageid: <1460411259.64.0.240212982983.issue26673@psf.upfronthosting.co.za> |
2016-04-11 21:47:39 | terry.reedy | link | issue26673 messages |
2016-04-11 21:47:39 | terry.reedy | create | |
|