I have downloaded the Fixedsys.TTF font.
I have moved the font into the /usr/share/fonts/truetype directory.
I have opened Emacs and navigated to Options > Set Default Font... and selected
FixedsysTTF and specified Monospaced and size 11. I then used Options > Save Options.
I have noticed in my .emacs file:
'(default ((t (:stipple nil :background "#232323"
:foreground "#e6e1de" :inverse-video nil :box nil
:strike-through nil :overline nil :underline nil
:slant normal :weight semi-bold :height 110
:width normal :foundry "unknown" :family "FixedsysTTF"))))
I do some work in Emacs and close it with Ctrl+c Ctrl+x.
I then reopen Emacs and it does not produce the same font. Rather, if I follow step 2. again I find that Emacs has defaulted to Monospace Regular 10. Although the font that is actually shown is not even Monospace Regular 10.
In order to correct this situation I am required to manually follow step 2. again and then everything is fine until I exit and startup again.
My question is whether or not there is a simple fix for this? Or, what lisp functions are being called in the background when I do step 2 so I can just hack the .emacs file to forcefully load fixedsys.
PS: I did try the font Fixedsys Excelsior, which is perfect BUT for the fact that in said version of Emacs (that is not to say that this happens in ONLY said version, but I am restricted to 23.3.1) the 'A' character causes the proceeding character to overlap the 'A'. However, this version of Fixedsys does not cause a problem with Emacs, and it remembers the font on exiting and the re-opening. Therefore, it is either: correct the situation with the overlapping 'A', or get the other version of Fixedsys (the one linked in step 1) to work. I do actually prefer Fixedsys Excelsior, but I cannot live with an overlapping 'A'. FYI, when I use Fixedsys Excelsior I get the following in my .emacs file:
'(default ((t (:stipple nil :background "#232323"
:foreground "#e6e1de" :inverse-video nil :box nil
:strike-through nil :overline nil :underline nil :slant normal
:weight normal :height 117 :width normal :foundry "unknown"
:family "Fixedsys Excelsior 3.01"))))
Again, the font is downloaded from the Fixedsys Excelsior link above and then the TTF moved into /usr/share/fonts/truetype.
Can someone help sort out either of these issues?
I have found out how to solve this issue:
Downloaded this modified version of FixedSYS
Moved to /usr/share/fonts/truetype
Injected:
(set-face-attribute 'default nil :font "Fixedsys Excelsior 3.01-L-12") into my .emacs file
Just to let you know, your links to Fixedsys.TTF font are pointing to a video site with questionable credentials.
Chris
Related
In my .emacs file, I have (set-face-attribute 'default nil :height 200) as the last line.
When I start up emacs, I actually see the text flash briefly to this size, but then quickly get resized to the default size (height 110).
How can I discover what's overriding my font setting?
My OS is Raspbian GNU/Linux 10 (buster).
Update: I've tried removing everything from my .emacs file, and then using M-x customize-face default to make the font height 200, as suggested by #Drew. My .emacs file now looks like
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 200 :width normal :foundry "1ASC" :family "Liberation Mono")))))
However, I'm still seeing the same effect on startup. A brief flash of size 200 and the font getting resized by something after that.
set-face-attribute with nil for the frame sets a face attribute for the frame that's selected when that function is invoked. Don't use it in your init file unless you know which frame will be selected when it's invoked, and you want to change the face on that frame.
Either customize face default or customize default-frame-alist (its font, color, etc. parameters). I suggest M-x customize-face default. That affects face default in general - the default for all new frames.
Beyond that, it's possible that something in your init file is changing the font of the default face later on. When you do M-x customize-face default you can see what the latest value of the font attribute is.
If you think something in your init file is messing things up, bisect your init file to find it. You can use command comment-region to comment out a block of code or (with C-u) uncomment a block of code. Comment out 1/2 of your init file, then 3/4, 7/8, 15/16,... till you find the culprit.
In both emacs 25.2.2 on Ubuntu 18.10, and 26.2 on arch we are experiencing the following weird behavior:
Ubuntu 18:
there is a .emacs file in my home directory.
If I run emacs, it works
.emacs sets indent style, font, and color
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight bold :height 180 :width normal :foundry "urw" :family "Nimbus Mono L")))))
(set-background-color "black")
(set-foreground-color "green")
When emacs is run by gnome-settings, it does not set the font correctly, but does set the indent and the color. I therefore conclude that the font setting is not working when gnome is first set up.
On arch, running emacs looks ok. But then if we load the file and M-x eval-buffer the font changes. Evaluating twice changes the font again. Eval a third time does nothing.
Can anyone explain what is happening, and how we can reliably select a font regardless of when the command is run?
I used the Options/Set Default Font menu item to set my default emacs font to be LMMonoLtCond10 (it brought up a nice font-selector GUI widget to let me do this). My emacs immediately adopted the new font, and I was very happy. I then did Options/Save Options, and on inspecting my .emacs.d/init.el file saw that it had written the following there:
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "white" :foreground "black"
:inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal
:weight light :height 120 :width normal :foundry "unknown" :family "LMMonoLtCond10"))))
(There are a couple of other faces I've defined below that.)
Unfortunately, if I quit emacs, and restart, it completely fails to recreate the font configuration that I had selected. Instead, I think it's giving me LMRoman-12. Am I doing something wrong, or is this an emacs bug.
I'm using Emacs 23.1.1:
(emacs-version)
"GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1)
of 2011-03-05 on palmer, modified by Debian"
on an Ubuntu system.
Sounds like it might be a bug. M-x report-emacs-bug
I just upgraded from Emacs 21.2 to 23.2 (on Windows XP) and while I managed to tweak my .emacs to fit the new changes, I couldn't find a solution for the unreadable buffer names:
Neither in the minibuffer, nor in the buffer menu can the characters be displayed normally. Instead, all I see are the infamous Unicode blank rectangles.
Any idea how to fix that?
Thanks.
Update: Again, all buffers are displayed perfectly (same font) - even with syntax highlighting. Buffers that contain buffer names also display everything properly, except for buffer names. Weird.
Could this possibly be related to the new feature introduced in Emacs 23.2 called "uniquify-buffer-name-style"?
The most likely explanation for rectangles is that your font doesn't have the required characters. The fix is to choose a different font (or install a more complete version of the same font).
Or is the problem that Emacs assumes the wrong encoding for file names? If so, please give more information, such as what encoding the file names are in, what it looks like Emacs is interpreting them as, and examples of working and non-working file names.
OK - with the help of Tim X from gnu.emacs.help, I found the offending lines in my .emacs that broke the new version (both statements need to be commented out!):
(setq default-frame-alist
(cons '(font . "-*-Lucida Console-normal-r-*-*-12-*-*-*-c-*-*-
iso8859-1")
default-frame-alist))
(set-default-font
"-*-Lucida Console-normal-r-*-*-12-*-*-*-c-*-*-iso8859-1")
Per Tim's advice, I used the Options menu to set the font and then save it to my .emacs. That resulted in appending the following 2-line single statement:
(custom-set-faces
'(default ((t (:inherit nil :stipple nil :background
"Black" :foreground "LightGray" :inverse-video nil :box nil :strike-
through nil :overline nil :underline nil :slant normal :weight
normal :height 90 :width normal :foundry "outline" :family "Lucida
Console")))))
By doing so, I am not sure my .emacs will continue working in Linux (as it did before - my .emacs was 100% cross-platform before).
I'm running Emacs, editing files in C++ mode and PHP mode. I love syntax highlighting as a concept, but the default colors are a travesty. I can barely read some of them: way too dark. What is the easiest way to change their values? I can't seem to find anything about this on the web. I don't even mind changing the binary as I'm compiling my own Emacs. I just want to find the place where it says blue is #0000FF and change it to #AAAAFF for example.
I find it easiest to use color-theme for this sort of thing.
But if you don't want to do that, put the cursor over the offending text, and hit M-x customize-face. It should default to the face that the cursor is over.
See 49.1.6 Customizing Specific Items.
Two ways - you can install the package color-theme, which has lots of nice schemes to select and is easier to do it by hand. The by-hand looks like this (in your .emacs file)
(custom-set-faces
custom-set-faces was added by Custom.
If you edit it by hand, you could mess it up, so be careful.
Your init file should contain only one such instance.
If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "lightyellow2" :foreground "gray20" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight bold :width normal :family "liberation mono"))))
'(background "blue")
'(font-lock-builtin-face ((((class color) (background dark)) (:foreground "Turquoise"))))
'(font-lock-comment-face ((t (:foreground "MediumAquamarine"))))
'(font-lock-constant-face ((((class color) (background dark)) (:bold t :foreground "DarkOrchid"))))
'(font-lock-doc-string-face ((t (:foreground "green2"))))
'(font-lock-function-name-face ((t (:foreground "SkyBlue"))))
'(font-lock-keyword-face ((t (:bold t :foreground "CornflowerBlue"))))
'(font-lock-preprocessor-face ((t (:italic nil :foreground "CornFlowerBlue"))))
'(font-lock-reference-face ((t (:foreground "DodgerBlue"))))
'(font-lock-string-face ((t (:foreground "LimeGreen"))))
...
etc. etc.
You can also type
`M-x customize-face RET`
which will give you all the customizations to set, ultimately end up in your .emacs file.
Put the cursor on a face ("color") that you want to change. Hit C-u C-x =. That will tell you which face(s) are present at that position, and it will let you click to customize it/them. Save your customizations.
If you don't care about color highlighting at all, or none of the previous answers work for you (or take too much time and effort to figure out), here is a very simple solution that will get rid of colors altogether.
Typing the following will get rid of colors:
M-x global-font-lock-mode
You can also do this as an interim step to allow you to actually see everything your screen to try any of the above answers. In my case, this was very useful because the color of certain key pieces of text which would allow me to change colors were themselves nearly invisible - for instance, the prompt of M-x.
If you want the change to be permanent, you can add this to your .emacs file:
(setq-default global-font-lock-mode nil)
Starting with Emacs 24.1, you can use M-x customize-themes to select a colour theme.
Emacs comes with a dozen or so themes with varying brightness and colourfulness, so you'll most likely find something that mostly matches your preferences.
You can also find more colour themes installable through MELPA at https://peach-melpa.org/ - no, that web site seems to be down. You can search for "theme" at melpa.org, but it doesn't show any screenshots.