Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: font failure in Emacs

  1. #1
    Join Date
    Mar 2006
    Location
    Arlington VA USA
    Beans
    450
    Distro
    Ubuntu 20.04 Focal Fossa

    font failure in Emacs

    I just installed a fresh Xubuntu on my laptop, and I have run into a problem that has me puzzled. When I connect to the servers of one of my customers with this laptop and try to run emacs I get the following error message:
    Code:
    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
    When the emacs window comes up all of the characters are represented by square boxes instead of recognizable character glyphs.

    Let me start by acknowledging that my understanding of X Windows, and in particular fonts under X Windows, is pretty thin. From a little Wikipedia reading, I get the picture that although the design of X Windows allows the rendering of fonts to happen on either the X client or the X server, "The use of server-side fonts is currently considered deprecated in favour of client-side fonts." [1] So I would think that the problem is on my customer's servers, not my laptop. But here's the puzzling part: I don't have this problem using emacs on those servers from any other machine, including X in Cygwin on Windows machines. And I can use emacs without this problem when connected to my own servers (running Debian). (The customer's servers are RHEL 5.5 boxes.)

    Any X Windows gurus out there who can tell me where to start looking to track down and solve this problem? Is it possible that in spite of what I've quoted above from Wikipedia (about the X client handling the font rendering) that it's the X server on my laptop which is missing something (this is the only machine on which I've installed xfce without already having gnome in place). If so, why wouldn't I run into the problem when connected to my Debian servers?

    Thanks for any enlightenment you can shed!

    [1] http://en.wikipedia.org/wiki/X_Font_Server

  2. #2
    Join Date
    Mar 2006
    Location
    Arlington VA USA
    Beans
    450
    Distro
    Ubuntu 20.04 Focal Fossa

    [Solved] Re: font failure in Emacs

    Well, in spite of that line from Wikipedia I quoted in the previous message, it looks like it's the X server (that is, my laptop) which renders the fonts (at least in Xubuntu). After further digging, I came up with a solution which involved creating the file ~/.Xdefaults with the line
    Code:
    emacs*font: 7x14
    and then running
    Code:
    xrdb -merge ~/.Xdefaults
    . Problem gone!

    So I guess Xubuntu/xfce leaves out fonts that the rest of the world assumes will be there. Hope this is useful to someone else who might run into the same problem.

  3. #3
    Join Date
    Jun 2012
    Beans
    1

    Re: font failure in Emacs

    Brilliant!!! I'm new to Ubuntu and I've been looking for the solution for a long time and it's now solved! Thanks!!!

  4. #4
    Join Date
    Mar 2006
    Location
    Arlington VA USA
    Beans
    450
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: font failure in Emacs

    I'm amused at how my brain works (or doesn't) as I get older. So yesterday I had a hardware failure and I needed to rebuild my workstation. Didn't take too long, and I get back to work and notice that as I start editing source code I've got nothing but square blocks in emacs. So I start googling and what do I find but my own post. Apply my own solution and I'm back on the road. A couple of minutes later screaqy's message hits my inbox. Gotta love the internet (and this forum)!

    @screaqy: glad it helped you, too.

  5. #5
    Join Date
    Oct 2011
    Beans
    5

    Re: font failure in Emacs

    Thanks for the fix - worked perfectly for me after a fresh install of emacs on 12.04!

  6. #6
    Join Date
    Sep 2012
    Beans
    1

    Re: font failure in Emacs

    Thanks this worked for me too!

  7. #7
    Join Date
    Apr 2013
    Beans
    8

    Re: font failure in Emacs

    Wow thanks a bunch, this worked for me as well.

  8. #8
    Join Date
    Apr 2013
    Beans
    8

    Re: font failure in Emacs

    Hi,

    This works for me but everytime I close down Ubuntu and then reopen I have to use the command -xrdb -merge ~/.Xdefaults over again. Does the .Xdefaults file have to be in a particular directory?

  9. #9
    Join Date
    Apr 2013
    Beans
    8

    Re: font failure in Emacs

    bump^

    Anyone know how I can avoid having to type 'xrdb -merge ~/.XDefaults' every time I reboot?
    Last edited by mguycooper; April 23rd, 2013 at 07:17 PM.

  10. #10
    Join Date
    Apr 2013
    Beans
    8

    Re: font failure in Emacs

    Nevermind! I think i just needed to add a new line to the end of the .Xdefaults file. Thanks again for the great solution!

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •