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

Thread: HOWTO: Beautiful Emacs

  1. #1
    Join Date
    Mar 2006
    Location
    Tempe, AZ
    Beans
    18
    Distro
    Ubuntu 8.04 Hardy Heron

    HOWTO: Beautiful Emacs

    The standard emacs package for Hardy looks incredibly horrible. The main reason for this is the ugly font it uses. The ugliness is exacerbated on large monitors. Anti-Aliased fonts improve the look tremendously. Unfortunately, the standard package doesn't support this...but the 'emacs-snapshot' package does. You'll need the universe repository enabled and then from a terminal:

    Code:
    apt-get install emacs-snapshot
    Edit the file: ~/.Xdefaults (which probably doesn't exist yet)
    Add the following line to this file:
    Code:
    Emacs.font: Monospace-10
    Monospace-10 is one of the AA fonts.

    Either restart X or just type the following form the terminal:

    Code:
    xrdb -merge ~/.Xdefaults
    When you start emacs make sure you run "emacs-snapshot-gtk" and not the standard package, "emacs" in case you also have that installed.

    I'd also recommend setting up a color theme with the color-theme library. Get it by typing this in a terminal:

    Code:
    apt-get install emacs-goodies-el
    Start emacs and do (M-x = hit the esc key and then the x key, RET = the Enter key):
    Code:
    M-x load-library RET
    color-theme
    Then do:
    Code:
    M-x color-theme-select
    Hit RET on each theme name to see it, 'd' to get a description including the real name of the theme.

    Once you have a theme you like, you can put it in your ~/.emacs so it'll load every time. If I want the "Gnome 2" theme, I'd put:

    Code:
    (require 'color-theme)
    (color-theme-gnome2)
    ColorTheme site:
    http://www.emacswiki.org/cgi-bin/wiki/ColorTheme

  2. #2
    Join Date
    Jul 2007
    Beans
    189
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Beautiful Emacs

    Screenshots pls?

  3. #3
    Join Date
    Mar 2006
    Location
    Tempe, AZ
    Beans
    18
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Beautiful Emacs

    This is using the "Monospace 10" AA font and the "Gnome 2" ColorTheme.
    Attached Images Attached Images

  4. #4
    Join Date
    Mar 2006
    Beans
    149

    Re: HOWTO: Beautiful Emacs

    For a cleaner look, you can add
    Code:
    (scroll-bar-mode -1)
    (menu-bar-mode -1)
    which will disable the scroll bar and menu bar respectively. You can always turn them back on if you need them, but I found leaving them on I was always tempted to use the gui instead of the key commands, which is where emacs' strength really lies.

  5. #5
    Join Date
    Jul 2008
    Location
    PA, USA
    Beans
    19

    Re: HOWTO: Beautiful Emacs

    Thanks saaz. I've been using emacs22-nox because the X version looked so bad. Now I have a choice.

  6. #6
    Join Date
    Oct 2007
    Beans
    67

    Re: HOWTO: Beautiful Emacs

    This is Monospace-10 in emacs.

    This is also Monospace-10 but in gedit.

    Here's emacs, gedit and the terminal side by side for comparison.


    Why is the font so thick in emacs? I want it to be small and smooth like it's shown in gedit.
    Last edited by frecon; November 15th, 2008 at 09:16 PM.

  7. #7
    Join Date
    Mar 2008
    Beans
    4,715
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Beautiful Emacs

    I don't know the solution to your problem with certainty.
    I believe the answer has to do with hinting. Full hinting yields thin font strokes, while no hinting yields thick font strokes.

    Hinting can be set in at least 3 different places and I'm not sure how these settings interact.

    The first place to set full hinting is by clicking on System>Preferences>Appearance>Fonts tab>Details.

    The second place is to edit or create a file called ~/.fonts.conf and put this in it

    Code:
    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
    <match target="font" >
    <edit mode="assign" name="rgba" > <const>rgb</const> </edit>
    <edit mode="assign" name="hinting" > <bool>true</bool> </edit>
    <edit mode="assign" name="antialias"> <bool>true</bool> </edit>
    <edit mode="assign" name="autohint" > <bool>false</bool> </edit>
    <edit mode="assign" name="hintstyle"> <const>hintfull</const> </edit>
    </match>
    </fontconfig>
    If you do "man 5 fonts.conf" you'll see that Fontconfig reads this file.

    The third place where hinting can be configured is /etc/fonts/conf.avail. These, I believe are system-wide font configuration files. I don't know enough to say with confidence how to edit these files, but if you look in /etc/fonts/conf.avail/53-monospace-lcd-filter.conf you might see something like
    Code:
        <edit name="hintstyle" mode="assign">
          <const>hintfull</const>
    Which I think means that monospace fonts are rendered with full hinting by default.

    So maybe if you set all hintstyle to hintfull in all three locations, maybe emacs will get the message.

  8. #8
    Join Date
    Oct 2007
    Beans
    67

    Re: HOWTO: Beautiful Emacs

    Quote Originally Posted by unutbu View Post
    The second place is to edit or create a file called ~/.fonts.conf and put this in it
    Thanks, that took away the thickness. But the font is still not quite right. The font is still too big. Look at this new screenshot and you'll see it compared to Gedit.

  9. #9
    Join Date
    Mar 2008
    Beans
    4,715
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Beautiful Emacs

    Check that you have these 2 lines in ~/.Xdefaults:
    Code:
    Emacs*Font: Monospace-10:antialias=True
    emacs.FontBackend: xft
    Then run
    Code:
    xrdb -merge ~/.Xdefaults
    This will set your font size to 10pt Monospace.

    If for some odd reason the above does not work for you, then you could also try putting this in your .emacs file:
    Code:
    (set-default-font "Monospace-10")

  10. #10
    Join Date
    Oct 2007
    Beans
    67

    Re: HOWTO: Beautiful Emacs

    Still no luck. It still look the same as the last screenshot.

Page 1 of 2 12 LastLast

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
  •