Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 4 down vote accepted

I'd guess it's a missing font that got replaced, heh, with squares (whether this is the "closest" font or not, I dunno, 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.

share|improve this answer
    
How do I get the name of the font from xfontsel? –  Sandra Schlichting Feb 6 '12 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 '12 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? –  130490868091234 Mar 27 '13 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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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