安装了Leo,试着运行。
开始第一次都正常,但第二次就打不开了。
查看运行的报错,发现是说:
AttributeError: 'NoneType' object has no attribute 'measure'
AttributeError: 'NoneType' object has no attribute 'metrics'
查了一下,是在 \Leo-4.8-final\leo\plugins\tkGui.py 文件的6752行
return self.font.measure(s)/self.font.measure('0')+1
也就是说 self.font 为None 了。
然后在几处调用self.font的代码前面加了:
if None == self.font:
return 500
勉强通过,可以打开了。看了一下log日志:
Exception loading Pmw module
Plugin leo.plugins.quicksearch does not support tkinter gui
Plugin leo.plugins.contextmenu does not support tkinter gui
Plugin leo.plugins.nav_qt does not support tkinter gui
Plugin leo.plugins.quicksearch does not support tkinter gui
Plugin leo.plugins.contextmenu does not support tkinter gui
Plugin leo.plugins.nav_qt does not support tkinter gui
exception setting font from 新宋体
family,size,slant,weight: 新宋体 8 roman normal
exception setting outline line height
Traceback (most recent call last):
File "C:\Program Files\Leo-4.8-final\leo\plugins\tkGui.py", line 6767, in setLineHeight
metrics = font.metrics()
AttributeError: 'NoneType' object has no attribute 'metrics'
exception setting font from 新宋体
family,size,slant,weight: 新宋体 9 roman normal
怀疑是中文字体 “新宋体”造成的问题?
另外
Exception loading Pmw module
Plugin leo.plugins.quicksearch does not support tkinter gui
是什么意思呢?
有高手路过给提点一下,谢谢了!