每当我打开Nedit时,都会出现以下错误----
Cannot convert string "-*-helvetica-medium-r-normal-*-*-120-*-*-*-iso8859-1" to type FontStruct
Cannot convert string "-*-helvetica-bold-r-normal-*-*-120-*-*-*-iso8859-1" to type FontStruct
Cannot convert string "-*-helvetica-medium-o-normal-*-*-120-*-*-*-iso8859-1" to type FontStruct
Cannot convert string "-*-courier-medium-r-normal-*-*-120-*-*-*-iso8859-1" to type FontStruct
Cannot convert string "-*-courier-bold-r-normal-*-*-120-*-*-*-iso8859-1" to type FontStruct
Cannot convert string "-*-courier-medium-o-normal-*-*-120-*-*-*-iso8859-1" to type
FontStruct
我无法在首选项中编辑字体样式。
答案1
经过大量搜索后,我这样做了,并且它有效(在 Ubuntu Precise 上,其他操作系统版本可能有不同的软件包安装命令)。所有 nedit FontStruct 错误都消失了。 :)
xlsfonts # Will show no fonts (or the wrong ones)
xset q # Shows no font paths
apt-cache search xfonts # Find them
sudo apt-get install xfonts-traditional # install them
# Answer no if it wants to reconfigure Xterm
sudo apt-get install xfonts-100dpi
sudo apt-get install xfonts-75dpi
# Not sure how many you need, I used these 3 packages.
# Pay attention to paths where apt-get puts them.
# Mine ended up here, e.g.
ls /usr/share/fonts/X11/100dpi/
# Tell X which paths to find them:
xset fp+ /usr/share/fonts/X11/100dpi/ # Configure X
xset fp+ /usr/share/fonts/X11/75dpi/
xset fp rehash # Make X reload
现在好多了。现在如果有人能将 nedit 更新到现代字体系统就好了……
答案2
nedit 与其他旧的 Motif(和 Xaw)应用程序一样,依赖于服务器端字体
大多数时候,nedit
这样的抱怨是因为某些字体(例如xorg-x11-fonts-100dpi
)丢失了,或者由于某种原因不在您的Xorg
字体路径中。通常,安装该字体(例如xorg-x11-fonts-100dpi
)可以解决问题。
如果没有,请将其添加到您的字体路径中,通过/etc/X11/xorg.conf.d/10-fonts.conf
:
例如
Section "Files"
FontPath "/usr/share/X11/fonts/100dpi"
FontPath "/usr/share/X11/fonts/cantarell"
FontPath "/usr/share/X11/fonts/encodings"
FontPath "/usr/share/X11/fonts/misc"
FontPath "/usr/share/X11/fonts/TTF"
EndSection
或通过~/.xinitrc
:
xset fp+ /usr/share/X11/fonts/100dpi
或者,您可以在终端中测试:
xset fp+ /usr/share/X11/fonts/100dpi
nedit
注意:我没有使用 RHEL,因此您可能需要相应地调整路径。