Terry J. Reedy added the comment:

#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?

----------
resolution: not a bug -> 
stage: resolved -> test needed
status: closed -> open
versions: +Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26673>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to