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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
10-03-2006, 07:28 AM
|
#1
|
Member
Registered: Jul 2003
Location: England
Distribution: Debian Jessie, FreeBSD 10.1 anything *nix to get my fix
Posts: 329
Rep: 
|
Emacs - changing default font size and font type?
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
|
|
|
10-03-2006, 08:34 AM
|
#2
|
Member
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757
Rep: 
|
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-"
|
|
|
10-03-2006, 04:54 PM
|
#3
|
Member
Registered: Jul 2003
Location: England
Distribution: Debian Jessie, FreeBSD 10.1 anything *nix to get my fix
Posts: 329
Original Poster
Rep: 
|
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
|
|
|
10-03-2006, 08:48 PM
|
#4
|
Member
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757
Rep: 
|
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"
|
|
1 members found this post helpful.
|
10-04-2006, 06:03 AM
|
#5
|
Member
Registered: Jul 2003
Location: England
Distribution: Debian Jessie, FreeBSD 10.1 anything *nix to get my fix
Posts: 329
Original Poster
Rep: 
|
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
|
|
|
10-04-2007, 12:32 PM
|
#6
|
LQ Newbie
Registered: Sep 2007
Posts: 2
Rep:
|
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 
|
|
|
11-07-2007, 12:25 PM
|
#7
|
LQ Newbie
Registered: Oct 2005
Location: Poland
Posts: 1
Rep:
|
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?
|
|
|
09-10-2008, 08:41 PM
|
#8
|
LQ Newbie
Registered: Sep 2006
Posts: 1
Rep:
|
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
|
|
|
09-19-2008, 04:41 PM
|
#9
|
LQ Newbie
Registered: Sep 2008
Posts: 1
Rep:
|
Quote:
Originally Posted by garstek
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.
|
|
|
08-05-2009, 01:31 AM
|
#10
|
Member
Registered: Sep 2008
Location: USA
Distribution: Linux Mint Qiana
Posts: 190
Rep: 
|
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
|
|
|
01-06-2010, 11:17 AM
|
#11
|
LQ Newbie
Registered: Jan 2010
Posts: 1
Rep:
|
Also:
To find out the name of a font you can do this:
1. select the font you want as you would with the mouse (shift+click and then use the font menu.)
2. type "M-x describe-font ENTER ENTER"
3. the name of the font is after "full name:".
Then you add it to .emacs.
for me:
(set-default-font "-Misc-Fixed-Medium-R-Normal--10-100-75-75-C-60-ISO8859-1")
(modify-frame-parameters nil '((wait-for-wm . nil)))
|
|
|
12-08-2010, 06:43 PM
|
#12
|
LQ Newbie
Registered: Dec 2010
Posts: 1
Rep:
|
Does anyone know the .emacs code for the font Monospace? I tried and all I got was LMRoman12. Definitely not what I want.
|
|
|
12-08-2010, 09:02 PM
|
#13
|
Member
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757
Rep: 
|
I currently use this:
(font . "9x15")
Look at my post above to see how to find others.
BTW, this is a really old thread. It wouldn't hurt to start a new one.
|
|
|
01-14-2011, 04:03 PM
|
#14
|
LQ Newbie
Registered: Jan 2011
Posts: 2
Rep:
|
A more visual way to do this is to click
options>set default font...
then to pick what you like and then click
options > save options
This will modify your .emacs file automatically and you don't need to know the complicated names of fonts.
hth
Jonathan
|
|
|
01-14-2011, 10:07 PM
|
#15
|
Member
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757
Rep: 
|
Quote:
Originally Posted by jrocher
options>set default font...
|
Ah! Very good.
I never would have thought of that because I never see the menu. I always have these in my .emacs file:
Code:
(menu-bar-mode -1)
(tool-bar-mode -1)
Quote:
Originally Posted by jrocher
This will modify your .emacs file automatically ...
|
Automatically mucking with my carefully edited configuration file won't make me happy.
|
|
|
All times are GMT -5. The time now is 02:10 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|