Changing the font in Aquamacs? - macos

I've recently had a need to do a bit of lisp editing and I found the nifty Ready Lisp package for OS X, which is great, except Aquamacs automatically uses a proportional font (which is idiotic, IMHO) and I want to change it to a monospace font. However, I'm not really much of an EMACS user, and the preferences menu in Aquamacs is less than clear on where and how one might make such a change.

In Aquamacs 2.1, you can set the font through Options->Appearance->Font for Text Mode... That brings up the standard font chooser window, choose the font you like. Then, when you exit out of emacs (C-x C-c) you'll be prompted to save options, hit "y".

This is what I have in my .emacs for OS X:
(set-default-font "-apple-bitstream vera sans mono-medium-r-normal--0-0-0-0-m-0-mac-roman")
Now, I'm not sure Bitstream Vera comes standard on OS X, so you may have to either download it or choose a different font. You can search the X font names by running (x-list-fonts "searchterm") in an ELisp buffer (e.g. *scratch* - to run it, type it in and then type C-j on the same line).

From the EmacsWiki Aquamacs FAQ:
To change the font used to display the
current frame, go to the font panel.
You can do this with the keystroke
Apple-t, or via the menu: Options →
Show/Hide → Font Panel. Once there,
select the font you want.
To make the current frame’s font the
default, go to Options → Frame
Appearance Styles. Select “use current
style for foo mode”, where foo is the
mode of the current frame (e.g.,
foo=text for text mode), to use the
current style (including the font, but
also any other changes you’ve made to
the frame’s style) for all files of
this type. Select “use current style
as default” to use the current style
for all files for whose major mode no
special style has been defined.
There are also recommendations for monospaced fonts - Monaco or "Vera Sans Mono".

this is the one I use:
-apple-DejaVu_Sans_Mono-medium-normal-normal-*-12-*-*-*-m-0-iso10646-1
You can set it in .emacs file like:
(set-default-font "-apple-DejaVu_Sans_Mono-medium-normal-normal-*-12-*-*-*-m-0-iso10646-1")
You can download it from dejavu-fonts.org

Fast forward a decade, for recent Aquamacs like ver 3.3 please see the nice solution for setting a fixed-width by default at https://emacs.stackexchange.com/questions/45135/change-permanently-font-size-in-aquamacs
Here's the relevant bit for those who are REALLY impatient but please go upvote that answer, user #nega deserves credit here
(when window-system
(setq initial-frame-alist nil) ;; Undo Aquamacs forced defaults
(setq default-frame-alist nil) ;; Undo Aquamacs forced defaults
(aquamacs-autoface-mode -1) ;; Use one face (font) everywhere
(set-frame-font "Menlo-12") ;; Set the default font to Menlo size 12
;;(set-default-font "Menlo-12") ;; This would do the same.
)

Related

Current line text font size gets increased while typing in Xcode

While I am typing on a specific line in workspace, the text present in the particular line's font is getting increased ! And it gets to regular size as soon as I stop typing.
I also upgraded to XCode 8.2 still the same issue occurs.
FYI:
I have also tried the following code to reset the XCode default settings, but still no use.
defaults delete com.apple.dt.Xcode
Solution:
This happens when you change font size for one particular element but the other editor's elements are using the previous/default font size.
If you want to change the font size either press cmd + or in preferences -> Fonts and Colors choose your theme and in the right pane select all the elements (press cmd a) and then change the font size.
See this SO answer
I had a similar problem but I am not sure is exactly the same.
Did you try to change this settings?
Xcode preferences > Fonts & Colors Your chosen theme will have a
"current line" option just under the font. Can't remember exactly but
I think you can find something there.

How can I set the default font size in aquamacs emacs?

I am having difficulty setting the default size in aquamacs emacs, under Lion. If I add something like
(set-face-attribute 'default nil :height 180)
To my .emacs file, the default size of the minibuffer will be 18pt, but the other buffers will still open at the old default size.
Options | Appearance | Font for Fundamental Mode (make sure you choose save options when quitting Aquamacs)
In aquamacs, it is not intuitive (understatement).
Options> customise Aquaemacs>SPecific Face...
then type, "default", just as it said above. This gets you to the screen where you can look really hard to find the "Height in 1/10 point" value.
Good luck!
-TPC
Probably the same way you do it for vanilla Emacs.
When you say "default" size, what do you mean? If you mean the default for future Emacs sessions also, then customize face default. Function set-face-attribute does not set the face persistently.
If you mean set it only for the current Emacs session, and set it for all existing and all future frames, then your code looks correct to me. In that case, consider filing a bug: M-x report-emacs-bug.

How do I set fonts on Emacs for Mac?

I downloaded Carbon emacs 23.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.35) from http://emacsformacosx.com/. It defaults to using Monaco, and I would like to change it to use Inconsolata-dz. So I added:
(set-default-font "-apple-Inconsolata-dz-medium-normal-normal-*-10-*-*-*-m-0-iso10646-1")
to my ~/.emacs file. However, after I restart, it is still Monaco. It discovered that Option-T (or maybe Command-T) brings up a font dialog, and if I select Inconsolata-dz from that, it works great. But if I restart, it is back to Monaco. So I tried setting the font from the menu, and then going to Customize Faces and saving it, but still it does not work. The interesting thing is that if I do M-x describe-font after changing the font from the Option-T dialog, it says -apple-Inconsolata-dz-medium-normal-normal--10--*-*-m-0-iso10646-1.
So it looks like Emacs is simply ignoring this font for some reason. Why is that, and what can I do to get it to use this font?
Update: I tried Donkopotamus and Joost Diepenaat's recommendations and they also did not work, although I ended up getting Times as my font, instead of Monaco. However, they work great if I just use the Inconsolata (not Inconsolata-dz). So I'm wondering if there is some problem with fonts with a dash in their name?
Update2: Why is this off-topic? The close message says "questions [should ...] relate to programming or software development in some way"; many developers use emacs, and getting settings right is important. The top two entries on a search for "programming fonts" have a combined 150; so font configs seem to be important to programmers. Anyway, if it is off-topic, where is the appropriate place to post it?
I use plain Inconsolata. From my emacs.d/init.el:
(set-face-attribute 'default nil
:family "Inconsolata" :height (case system-type
('gnu/linux 130)
('darwin 145)) :weight 'normal)
If you're only running on OSX, you can simplify that to
(set-face-attribute 'default nil
:family "Inconsolata" :height 145 :weight 'normal)
I use Inconsolata. In my .emacs I simply set the default font to Inconsolata using
; check if we're on OSX
(when (featurep 'ns-win)
(custom-set-faces
'(default ((t (:height 140 :width normal :family "Inconsolata")))))
)
I've seen this behavior on Mac, and now I do this in my emacs init file:
(set-face-attribute 'default nil :foundry "apple" :family "Anonymous_Pro")
That works nicely for me, but note that I'm using a newer (HEAD) version of Emacs. You would presumably need to use "Inconsolata-dz" as the value for :family.
Without this, new frames would always pop up using the system-wide default monospaced font (Monaco), which is likely what's happening for you.
P.S. Your Emacs version is a Cocoa Emacs, not a Carbon Emacs.
Are you sure your .emacs is being read in? For example, are other things in there taking effect?
Assuming that is okay, I use this in my init file:
;; (insert "\n(set-default-font \"" (cdr (assoc 'font (frame-parameters))) "\")\n")
Note that it is intentionally commented out. Now set your font using Command-T, then go to the end of the above line and do C-x C-e . It will insert a command to set your font to whatever it is now. Save/exit/enter Emacs and you should have your font.

Setting emacs font under windows

I'm having trouble to change the font for my emacs configuration.
I've tried using set-default-font, and managed to tab to my desired font, however, some elements are still rendered as the old font (ie python's class names and function names)
set-default-font is really old, and has been deprecated in Emacs 23 in favor of its new name set-frame-font (which isn't much better). The current Emacs manual suggests several ways to set the default font, but I'll assume you've found those already, seeing as you've tried set-default-font...
The elisp code I use is actually different from all the methods suggested there:
;; [in .emacs]
;; Use 10-pt Consolas as default font
(set-face-attribute 'default nil
:family "Consolas" :height 100)
set-face-attribute seems to stick better than set-default-font; at least it seems to use Consolas consistently even in things like Python class and function names.
M-x customize-face default will let you customize the default font.
If some things are still rendered in a font you don't like, then position your cursor to be over the offending text and type M-x customize-face; the face that your cursor is over will be the default one to customize.

Can I change the size of the Xcode IDE fonts?

I'd like to change the font size of the "Groups & Files" panel of the Xcode IDE. I know how to change the "Fonts & Colors" in the preferences, but those (seem to) only affect the code window, not the rest of the IDE. Any ideas? Thanks!
I believe you can change the size of the Groups & Files pane by setting the PBXTableFontSize parameter in ~Library/Preferences/com.apple.Xcode.plist. This needs PBXTableFont to be set first to take effect.
1) Run defaults write com.apple.Xcode PBXTableFontSize 20 in Terminal, substituting 20 for whatever value you wish to use.
2) Run defaults write com.apple.Xcode PBXTableFont Helvetica in Terminal, substituting Helvetica for the font you wish to use. I'm not sure what OS X's default Sans Serif font is, but Helvetica is pretty generic.
I also wanted to do so. It's ridiculously small!
No, I don't believe this is possible - unless you want to start hacking away at XCode's internal structure. I'd file an enhancement request on this.

Resources