Hot answers tagged

31

I have the following in my .emacs using Emacs for OSX: (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 (:stipple nil :background "white" :foreground "black"...


21

buffer-face-set and buffer-face-mode in Emacs 23 or later is designed for exactly this. From the Emacs wiki: ;; Use variable width font faces in current buffer (defun my-buffer-face-mode-variable () "Set font to a variable width (proportional) fonts in current buffer" (interactive) (setq buffer-face-mode-face '(:family "Symbola" :height 100 :...


16

I use this in my init.el: ;; Set default font (set-face-attribute 'default nil :family "Source Code Pro" :height 110 :weight 'normal :width 'normal) You could try the same using Inconsolata instead of Source Code Pro.


14

Try replacing the code for setting the font size with this: (set-face-attribute 'default nil :font "DejaVu Sans Mono-14") (set-face-attribute 'mode-line nil :font "DejaVu Sans Mono-10") Of course, you'll want to change the sizes (14 and 10) to values of your liking. If you want to customize a specific face and don't know the name of it, try doing M-x ...


12

If you changed something in .Xresources file then you need to reread it to see any changes in current session. To keep your old resources settings and apply new one: xrdb -merge ~/.Xresources To throw away your old resources and apply only settings from .Xresources: xrdb ~/.Xresources Adjustments in .Xresources file are better, because they are applied ...


11

Okay I found a solution that worked for me. (defun my/org-mode-hook () "Stop the org-level headers from increasing in height relative to the other text." (dolist (face '(org-level-1 org-level-2 org-level-3 org-level-4 org-level-5)) (set-face-attribute face nil :weight 'semi-bold ...


10

If you want to use a GUI font picker with previews and all, you may use M-x menu-set-font


10

You're not doing anything wrong. Emacs for Linux uses XFT for font rendering, and XFT doesn't yet support the color fonts. See this mailing list thread from Dec 2015. Richard Stallman writes in that thread that it's a low priority and they don't care about color fonts. Also in that thread you can see that they disabled color fonts in Emacs for Mac, not for ...


9

One solution is to modify org-indent-strings to use stars instead of spaces as the indentation character. This means that the width of the indentation will always be correct, even when using a proportional font. The trick then is to set the foreground color of the indentation to be the same as the background color, so that the stars become invisible. We ...


9

emacs for now doesn't support ligatures (on OSX there is some support, but not on other platforms). However, emacs 24.4+ supports prettify-symbols-mode which in some ways is better than normal ligatures support. That mode allows to subsitute for display any regex with any glyph. I am personnally using this snippet to get Fira Code ligatures to work in emacs ...


9

Maybe use a buffer-local value for face-remapping-alist to remap default to something else in that one buffer? See C-hig (elisp) Face Remapping RET e.g.: (face-remap-add-relative 'default :family "Monospace") or in a file-local variable block. e.g.: ;; Local Variables: ;; eval: (face-remap-add-relative 'default :family "Monospace") ;; End:


9

Customize LaTeX-font-list: M-x customize-variable RET LaTeX-font-list RET. Select Math Prefix: for ^C key (the prefix C-c C-f is omitted) and add \mathscr{ to "Math Prefix:" field and } to "Math Suffix".


8

Some themes change faces for no good reason. For example, if you are using Solarized theme add code below before loading it. (setq solarized-use-variable-pitch nil solarized-scale-org-headlines nil)


8

Yes. What you want is to zoom (the font size for) a frame, regardless of which buffers are displayed there. See library zoom-frm.el, and these descriptions of zooming a frame and zooming a buffer. See, in particular, command zoom-in/out, which does both. It is bound by default to the keys normally bound to just buffer zooming: C-x C-+, C-x C--, C-x C-0, ...


8

If of use: I came across Sacha's post that talks about how to do this. Based on the code in her post and on the feedback from the comments, I now use the code below (I have a light theme). You may note lazy loading, this prevents an 'undefined' error at start up as per a comment in original blog post: (defun my/modify-org-done-face () (setq org-fontify-...


8

Emacs doesn't allow fonts that have hyphens in them. I would rename the font to something that doesn't contain hyphens. You can do this using ttx. For example, assuming you have a font named Inconsolata-dz for Powerline.otf in your current working directory: # Convert the font to ttx format (an xml-like font format) ttx "Inconsolata-dz for Powerline.otf" #...


7

The second element of the font-info is the font's pixelsize, which is (roughly speaking) its height. Getting the width of any particular glyph in the font is a little more work: (aref (aref (font-get-glyphs (font-at (point)) 65 66) 0) 4)


7

Thanks to the answer provided by itsjeyd I managed to write a short expression to change the size of all mode-line related faces for all current and future frames. If you're using other themes besides the default one (such as zenburn, etc.), the code should be put after you've declared the theme; i.e., after this line: (load-theme 'solarized-light t) ...


7

This occurs because Emacs uses different fonts for different parts of the Unicode character set. You can verify what font is being used by positioning the cursor over a character and pressing C-u C-x =. For instance, with my configuration over an ASCII character I get nil:-apple-Consolas-medium-normal-normal-*-14-*-*-*-m-0-iso10646-1 (#x88), but over a ⧺ I ...


7

Yes. You can put a function on after-make-frame-functions (or perhaps make-frame-functions) that tests which display (monitor) is used and adjusts the frame's default font height (size) appropriately. That function can use function display-monitor-attributes-list to determine which display is used. It can then change the size of the frame's font, if ...


7

Org headings are controlled by the faces org-level-1, org-level-2 etc. You can get to them via M-x customize-face. Unselecting the height attribute should set them to the default font size.


6

I use agda-mode with a lot of mathematical symbols and have had the same problem. Used to be the only real solution was as @shosti suggests: customizing the font mappings. In my case, I had to disable a number of fonts because even though I had fonts installed with particular glyphs defined, emacs would often choose the wrong one (displaying boxes). Seemed ...


6

To help you track it next time This happened to me before. There was a situation where string-to-int crashed Emacs, and it took me hours to pinpoint as well. Sorry I can't provide a nicer answer, but Emacs crashes happen deep down in the C code, and there aren't any built-in tools available to track down such problems. I suppose debugging it with gdb is ...


6

Playing with Emacs’ fontsets definitions should be the answer. After reading Fontsets docs: The startup fontset will use the font that you specify, or a variant with a different registry and encoding, for all the characters that are supported by that font, and fallback on ‘fontset-default’ for other characters. If some characters appear on ...


6

You can't. A proper text layout for proportional fonts would require dynamic re-filling of paragraphs, which is generally impossible to do correctly with info documents, since they contain no semantic information at all. Same for docstrings, which you see in Help Mode, except that these don't even start with any markup at all... Hence it's impossible to ...


6

What you want to do is to set the display-table entry for character LEFT-TO-RIGHT EMBEDDING to the glyph that is used for character SECTION SIGN. (aset (or (window-display-table) standard-display-table) 8234 ; 0x202A, which is the char LEFT-TO-RIGHT EMBEDDING (vector (make-glyph-code ?§))) If the selected window has its own display table, then ...


6

This can be done pretty easily. press M-x RET customize-face RET font-lock-function-name-face RET and you'll get the customization menu for function name face. You can change any attribute you want(font weight, height, color, etc.) and don't forget to click on Apply and Save and save for future sessions.


5

I am not sure if that's the problem you are having but this reminded my of a problem I've had for like ten years. Emacs did not accept the size asigned to its frames (e.g. X11 windows) by the windowing system (e.g. X11) and reduced the size based on the proportions of the font used for the default face. When using a tiling window manager that then results in ...


5

This always works whenever I want to try other fonts (put it in your init.el or .emacs file): (push '(font . "Inconsolata") default-frame-alist) or (add-to-list 'default-frame-alist '(font . "Inconsolata")) In this case both expressions are equivalent. In short, these forms set the font for the current and all future Emacs frames. Since these are saved ...


5

Emacs is stuck somewhere between not supporting font fallback at all and supporting fully automatic fallback. As soon as you tell it to use a specific font, it will make use of this font's glyphs only, requiring you to explicitly set up fallback fonts with a fontset to display any extra glyphs not covered by it. Your arabic font for example doesn't have ...


Only top voted, non community-wiki answers of a minimum length are eligible