简体   繁体   English

远程服务器上的emacs字体出现问题

[英]Issue with emacs font on remote server machine

When I am trying to open emacs on the server machine after logging in using the command 使用命令登录后尝试在服务器计算机上打开emacs时

ssh -X username@server.com

I get gibberish text on emacs with everything converted to square boxes. 我在emacs上得到了乱七八糟的文字,所有内容都转换为方形框。 I also get warnings on the terminal saying 我还在终端上说警告

Warning: Cannot convert string "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" to type FontStruct
Warning: Cannot convert string "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1" to type FontStruct

I assume some fonts are missing and need to be installed manually or some settings need to be altered at the remote machine. 我认为缺少某些字体,需要手动安装,或者需要在远程计算机上更改某些设置。 I am using Ubuntu terminal for connection to remote server and emacs invocation. 我正在使用Ubuntu终端连接到远程服务器和emacs调用。

Explanation and solution (if you don't have access to the remote fonts installation) here: 说明和解决方案(如果您无权访问远程字体安装):

https://superuser.com/questions/247435/cant-export-emacs-display-on-ssh https://superuser.com/questions/247435/cant-export-emacs-display-on-ssh

But I'd really go with @Tikhon_Jelvis's way (see above comment #1 to your question) which is definitely more "emacsy" and possibly lighter as, I guess, no X connection is forwarded... 但是我真的会使用@Tikhon_Jelvis的方式(请参阅上面的问题#1),它肯定更“模糊”,并且可能更轻巧,因为我猜没有转发X连接...

You can try to change the font path in xorg.conf : 您可以尝试在xorg.conf中更改字体路径:

Version with problems 有问题的版本

Section "Files" “文件”部分
# paths to defoma fonts #defoma字体的路径
FontPath "/usr/share/X11/fonts/misc" FontPath“ / usr / share / X11 / fonts / misc”
FontPath "/usr/share/X11/fonts/cyrillic" FontPath“ / usr / share / X11 / fonts / cyrillic”
FontPath "/usr/share/X11/fonts/100dpi/:unscaled" FontPath“ / usr / share / X11 / fonts / 100dpi /:unscaled”
FontPath "/usr/share/X11/fonts/75dpi/:unscaled" FontPath“ / usr / share / X11 / fonts / 75dpi /:unscaled”
FontPath "/usr/share/X11/fonts/Type1" FontPath“ / usr / share / X11 / fonts / Type1”
FontPath "/usr/share/X11/fonts/CID" FontPath“ / usr / share / X11 / fonts / CID”
FontPath "/usr/share/X11/fonts/100dpi" FontPath“ / usr / share / X11 / fonts / 100dpi”
FontPath "/usr/share/X11/fonts/75dpi" FontPath“ / usr / share / X11 / fonts / 75dpi”
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" FontPath“ /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType”
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID" FontPath“ /var/lib/defoma/x-ttcidfont-conf.d/dirs/CID”
EndSection 结束部分

Version without any problems 版本没有任何问题

Section "Files" “文件”部分
# paths to defoma fonts #defoma字体的路径
FontPath "/usr/share/fonts/X11/misc" FontPath“ / usr / share / fonts / X11 / misc”
FontPath "/usr/share/fonts/X11/cyrillic" FontPath“ / usr / share / fonts / X11 / cyrillic”
FontPath "/usr/share/fonts/X11/100dpi/:unscaled" FontPath“ / usr / share / fonts / X11 / 100dpi /:unscaled”
FontPath "/usr/share/fonts/X11/75dpi/:unscaled" FontPath“ / usr / share / fonts / X11 / 75dpi /:unscaled”
FontPath "/usr/share/fonts/X11/Type1" FontPath“ / usr / share / fonts / X11 / Type1”
FontPath "/usr/share/fonts/X11/CID" FontPath“ / usr / share / fonts / X11 / CID”
FontPath "/usr/share/fonts/X11/100dpi" FontPath“ / usr / share / fonts / X11 / 100dpi”
FontPath "/usr/share/fonts/X11/75dpi" FontPath“ / usr / share / fonts / X11 / 75dpi”
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" FontPath“ /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType”
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID" FontPath“ /var/lib/defoma/x-ttcidfont-conf.d/dirs/CID”
EndSection 结束部分

Tell me if it works for you. 告诉我它是否适合您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM