When I open emacs over an SSH connection I get this error

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

and the font is replaced with empty squares.

Does anyone know what could be wrong?

enter image description here

3 Answers 3


I'd guess it's a missing font that got replaced, heh, with squares (whether this is the "closest" font or not, I don't know, and YMMV).

For a quick fix, if you have xfontsel in the remote system, you can use that to check for an available font (select it in xfontsel, then hit "Select" to copy it to the selection, and paste it in another X application (click with the middle mouse button)) and then try emacs -fn fontspec where fontspec is the string built by xfontsel.

Fixing this would probably involve installing the missing fonts in the remote computer, so that emacs can use these fonts (I guess it's something like adobe-fonts? look for that kind of package in the remote system package manager (if you have an account with UID=0 there, of course, otherwise either you ask the administrator, or you have to use a workaround)).

If you want to change the emacs font like above, you can put that in ~/.Xdefaults. I'd not be surprised if you could do the same in ~/.emacs.

  • How do I get the name of the font from xfontsel? Feb 6, 2012 at 12:29
  • 1
    Right, I forgot that, there's the "select" button on the top left corner that copies the font name to the "selection clipboard", just hitting the middle mouse button inside another X window with text input should paste it.
    – njsg
    Feb 6, 2012 at 13:24
  • I am facing exactly the same problem. I ran xfontsel which came up with a single available font. I set it up in my .emacs file (set-default-font "-bitstream-courier 10 pitch-medium-r-normal--17-120-100-100-m-0-adobe-standard"), but it didn't solve the problem. It still looks exactly the same. I changed .Xdefaults to contain xterm*VT100*font:-bitstream-courier 10 pitch-medium-r-normal--17-120-100-100-m-0-adobe-standard, and no difference. Any ideas?
    – 719016
    Mar 27, 2013 at 13:32

Put it into your ~/.Xdefaults such as:

emacs*font: -*-fixed-medium-r-normal-*-15-*-100-100-*-*-iso8859-*

Then merge it to the X resource database with:

xrdb -merge ~/.Xdefaults

Issue is basic, the Fonts are not present in your SSH client system

Just install the Xming extra fonts


Then restart every thing .. Should work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.