Rhel

在 nedit 中更改字型大小時出現問題

  • January 26, 2019

每當我打開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

我無法在首選項中編輯字型樣式。

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,因此您可能需要相應地調整路徑。

經過大量搜尋,我做到了,並且它可以工作(在 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 更新為現代字型系統…

引用自:https://unix.stackexchange.com/questions/76179