执行时出现 tkdiff 空白错误消息 "font actual system"

tkdiff blank error message while executing "font actual system"

我正在尝试使用现在备受推崇的 tkdiff 工具,但是 运行 遇到了麻烦。我有 2 个 Linux 系统。第一个系统,一个 Redhat EL 6.4 工作站,运行s tkdiff 非常好——我可以整天比较文件。

在第二个系统上,CentOS 6.6 版服务器,tkdiff 失败并显示以下堆栈跟踪:

Error in startup script: 
    while executing
"font actual system"
    invoked from within
"set sysfont [font actual system]"
    (file "<path...>/bin/tkdiff" line 122)

我不知道为什么在“:”和 "while executing" 之间没有给我错误消息...很奇怪。

我在这个问题上摸不着头脑,我尝试了一些方法,例如:

我猜我的 CentOS 服务器可能遗漏了一些其他依赖项?

更新:

好吧,这绝对是一个依赖关系。我的大脑对细节有点模糊,但我记得就错误处理而言,从 wish 提示与仅 运行 脚本获取时存在一些细微差别。根似乎可能是缺少字体依赖项,如该实验所示:

$ wish
% font actual system
% puts $errorInfo

    while executing
"font actual system"
% puts $errorCode
NONE
% 

显然它对 font actual system 不满意。奇怪的是,$errorCodeNONE。之前安装了 libXft 和 fontconfig 包。我刚刚安装了以下额外的 yum 软件包:

xorg-x11-utils
libXv
libXxf86dga
libdmx
tk-devel (which installed fontconfig-devel and a bunch of other dependancies)
tcl-devel

TL;DR: X 显示服务器(本地 RHEL 工作站)上的系统字体未安装在 wish 所在的 X 客户端上 运行 (CentOS服务器)。

我认为问题至少部分是由于我是 运行 CentOS 服务器上的 tkdiff 程序并通过 X 显示到我原来的 RedHat 工作站。我获取了根本原因 (while executing "font actual system") 的 tcl 堆栈跟踪,并使用它来缩小问题范围。在 RedHat 上,我启动了 wish 并执行了该命令以获得以下响应:

RedHat>$ wish
% font actual system
-family {DejaVu Sans} -size 12 -weight normal -slant roman -underline 0 -overstrike 0
% 

我推断 CentOS 服务器,因为它通过 X 显示到我的 RHEL 框,将尝试使用相同的系统字体。快速搜索未转换为该字体的正确 yum 包,因此我安装了它。

sudo yum install dejavu-sans-mono-fonts

瞧!在 CentOS 上,我现在得到:

CentOS>$ wish
% font actual system
-family {DejaVu Sans Mono} -size 12 -weight normal -slant roman -underline 0 -overstrike 0
%

最终测试:tkdiff 现在运行正常!