LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Thread Tools
Old 10-03-2006, 08:28 AM   #1
neilcpp
Member
 
Registered: Jul 2003
Location: England
Distribution: Mandrake 2009 + Debian etch
Posts: 304
Thanked: 0
Unhappy Emacs - changing default font size and font type?


[Log in to get rid of this advertisement]

Hello, I have tried to research this. I have found the built in help system hard to follow and cannot find where this particular problem is answered. I have also tried posting this question to usenet, with no satisfactory response.

I am using Emacs 21.3.1 under FreeBSD 6.1. I want to change the default font size AND the default font type permanently, by making a entry into the .emacs initi file.

Normally, i temporarily change the size AND type of font by holding down shift and left clicking the mouse button. I then get a menu of fonts and always select this:

courier (type)
18 (size)

MY QUESTION:

Please show me precisely what I need to write in the .emacs file in order for the courier (type) and 18 (size) to be made my default font type and size.

Currently, my .emacs file simply has the entry: (set-default-font "9x15"), which is a bit larger, but i do not like the font type. Thats why I need a specific reply to this, if possible.

Thanks
neilcpp is offline     Reply With Quote
Old 10-03-2006, 09:34 AM   #2
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora, Mandriva, PCLinuxOS
Posts: 329
Thanked: 0
There are some shortcut names like the "9x15" you are using (also "8x13"), but normally it expects the X font name like this:
-MAKER-FAMILY-WEIGHT-SLANT-WIDTHTYPE-STYLE-PIXELS-HEIGHT-HORIZ-VERT-SPACING-WIDTH-CHARSET

You can run these commands (at least on Linux, probably on FreeBSD too) to see what fonts are on your system:
Code:
xlsfonts            ## This displays system fonts
xfd -fn fontname    ## This pops up a window displaying it
Here are some that I have tried on my Linux system:
Code:
"-*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard"
"-*-Fixedsys-normal-r-*-*-*-*-*-*-c-*-*-ansi-"
"-raster-Fixedsys-normal-r-normal-normal-12-90-96-96-c-80-iso8859-1"
"-raster-Terminal-normal-r-normal-normal-16-120-96-96-c-120-ms-oemlatin"
"-*-Fixedsys-normal-r-*-*-15-112-*-*-c-80-*-ansi-"
KenJackson is offline     Reply With Quote
Old 10-03-2006, 05:54 PM   #3
neilcpp
Member
 
Registered: Jul 2003
Location: England
Distribution: Mandrake 2009 + Debian etch
Posts: 304
Thanked: 0

Original Poster
Thanks, -I'm sure the available fonts are the same for Linux and FreeBSD...but could you help me by identifying:

1. The full name of the font type AND size for courier 18?

2. The exact wording that i need to place in the .emacs file, so it will be started automatically eash time.

Thanks 4 help
neilcpp is offline     Reply With Quote
Old 10-03-2006, 09:48 PM   #4
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora, Mandriva, PCLinuxOS
Posts: 329
Thanked: 0
OK, I fired up FreeBSD in VMware, which I hadn't done in some time. This worked. The first line just prints to stdout so you can see you've isolated one font name. The second command pops up a window showing you the font. You can toy with the grep arguments to get different choices.
Code:
xlsfonts | grep courier-medium-r | grep .-18- | grep 59-1$
xfd -fn $(xlsfonts | grep courier-medium-r | grep .-18- | grep 59-1$)
On both Gnu/Linux and FreeBSD, one font that might interest you is:

"-adobe-courier-medium-r-normal--18-180-75-75-m-110-iso8859-1"
KenJackson is offline     Reply With Quote
Old 10-04-2006, 07:03 AM   #5
neilcpp
Member
 
Registered: Jul 2003
Location: England
Distribution: Mandrake 2009 + Debian etch
Posts: 304
Thanked: 0

Original Poster
Thanks.. i simply put in .emacs file:

(set-default-font "-adobe-courier-medium-r-normal--18-180-75-75-m-110-iso8859-1")

and it works automatically now. thanks
neilcpp is offline     Reply With Quote
Old 10-04-2007, 01:32 PM   #6
iOuZo
LQ Newbie
 
Registered: Sep 2007
Posts: 2
Thanked: 0
thanks neilcpp, i have been searching for about a hour on how to do that... i used the exact same font * size as you did... nice
iOuZo is offline     Reply With Quote
Old 11-07-2007, 01:25 PM   #7
garstek
LQ Newbie
 
Registered: Oct 2005
Location: Poland
Posts: 1
Thanked: 0
Thanks, neilcpp, your instructions worked. However...

it now takes quite a while for emacs to show text in a buffer after opening a file. How can I change this, without going back to standard font settings?
garstek is offline     Reply With Quote
Old 09-10-2008, 09:41 PM   #8
dsleb
LQ Newbie
 
Registered: Sep 2006
Posts: 1
Thanked: 0
Lightbulb try $xfontsel to experiment with font options

Hi... thanks for the help, just what I needed

Here is a nifty tool for finding a font you like in a format suitable syntax:

in terminal:

$ xfontsel
dsleb is offline     Reply With Quote
Old 09-19-2008, 05:41 PM   #9
Thorendor
LQ Newbie
 
Registered: Sep 2008
Posts: 1
Thanked: 1
Quote:
Originally Posted by garstek View Post
it now takes quite a while for emacs to show text in a buffer after opening a file. How can I change this, without going back to standard font settings?
The delay caused by set-default-font can be worked around by adding the following at the beginning of your .emacs file:
(modify-frame-parameters nil '((wait-for-wm . nil)))

See https://launchpad.net/metacity/+bug/23005 for more details.
Thorendor is offline     Reply With Quote
Thanked by:
Old 08-05-2009, 02:31 AM   #10
faizlo
Member
 
Registered: Sep 2008
Location: USA
Distribution: Ubuntu 9.04 (finally made the move!)
Posts: 58
Thanked: 0
I deleted my .emacs file by mistake, and when I created a new one with the following two lines:
Code:
(set-default-font "-adobe-courier-medium-r-normal--18-180-75-75-m-110-iso8859-1")
(modify-frame-parameters nil '((wait-for-wm . nil)))
But it gives me the error below:
Code:
No fonts match `Monospace-10'
What's wrong?

I do not have a .Xresources file in my ~/ area.

Faizlo
faizlo is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to increase the font size in emacs CodeWarrior Linux - Software 4 11-04-2009 11:34 PM
Help with font size in emacs? shadow5277 Linux - General 3 02-24-2006 04:48 AM
emacs font size pfaendtner Linux - Software 2 09-24-2004 05:08 AM
font size in emacs koyi Linux - Software 0 06-28-2004 09:35 AM
xterm font size and type centr0 Linux - Software 4 05-24-2003 06:32 PM


All times are GMT -5. The time now is 08:24 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration