Bold attribute doesn't work - emacs

I'm trying to make font in Emacs a little bolder. I use Inconsolata and here is a snippet from my .emacs:
(when window-system
(set-face-attribute 'default
nil
:font "Inconsolata"
:height 120
:weight 'bold) ; <- this line does not affect rendering
(require 'color-theme-solarized)
(color-theme-solarized-dark)
(x-send-client-message nil 0 nil "_NET_WM_STATE" 32
'(2 "_NET_WM_STATE_FULLSCREEN" 0)))
I know that Inconsolata can be rendered bold, but for some reason Emacs always renders it with normal weight. Maybe I should enable something before trying to change font?

Unfortunately, original Inconsolata does not have bold variant, applications emulate Inconsolata Bold by increasing character width. This is why one can use 'bold' variant of Inconsolata in some of them.
According to this Wikipedia article:
when Inconsolata was added to Google Fonts, it was fully hinted and a bold variant was added
So it is important which version of the font one uses. I've removed original Inconsolata and installed Google Fonts this way (Arch Linux):
# yaourt -S ttf-google-fonts-git
If you encounter such a problem, try searching for a similar package for your Linux distribution.

(when window-system
(set-face-attribute 'default
nil
:font "Inconsolata"
:height 120
:bold t)
(require 'color-theme-solarized)
(color-theme-solarized-dark)
(x-send-client-message nil 0 nil "_NET_WM_STATE" 32
'(2 "_NET_WM_STATE_FULLSCREEN" 0)))

Old thread, but I ended up here trying to find update of what I'm
doing now (haven't found yet)... but this simple trick may be
useful (year 2019 linux X, emacs 26.1 Gtk+3, and xft fonts):
emacs -xrm Xft.embolden:true -fn Inconsolata-14
This makes all variabts (regular, italics, bold, bolditalics)
(even) bolder when such variants exist. -fn Inconsolate-15:weight=bold affected only regular for me (without that -xrm ... option).

Related

archlinux emacs can't autoload monaco-fonts

I installed the monaco fonts from the AUR in archlinux, and set emacs's fonts to monaco, but it doesn't load the monaco fonts when emacs starts, I have to set the font to monaco manually when starting emacs, can anyone one give me some hint of what to do?
This is part of my .emacs.d/init.el:
(custom-set-faces
'(default ((t (:family "Monaco" :foundry "unknown" :slant normal :weight normal :height 128 :width normal)))))
I find the (custom-set-faces ...) doesn't make sense in this case, I use the following code found in https://superuser.com/ and succeed.
(set-frame-font "Monaco 14" nil t)
(add-to-list 'default-frame-alist
'(font . "Monaco 14"))

problems with emacs color themes, set-fontset and font-lock

I use the following to ensure that lambda symbols etc are displayed using a specific font
(set-face-attribute 'default nil :family "PragmataPro")
(set-face-attribute 'default nil :height 130)
;; over-ride "fontset-defult" for all unicode characters
(set-fontset-font "fontset-default" 'unicode "PragmataPro")
And use a pretty lambda font-lock when working in scheme,
(defun pretty-lambdas ()
(font-lock-add-keywords nil
'(("(\\(lambda\\)\\>" (0 (prog1 ()
(compose-region (match-beginning 1)
(match-end 1)
?λ)))))))
this works fine when using the default emacs theme, but if i change theme M-x load-theme: - the λ becomes some kind of "eastern" symbol, even though the character glyph for λ is provided by the face.
Any ideas? Is the load theme over-riding something?
-- EDIT --
I though the problem has solved itself, with the regular face it is now fine, but it still happens with italics.

Emacs AucTex Latex syntax prevents monospaced font

My emacs (Aquamacs with AucTex) changes font size (in e.g. LaTeX mode) to show the syntax - like this:
Unfortunately this ruins the point of a monospaced font - e.g. my comments do not align. How do I solve this problem?
For the specific example of sections, chapters, etc., add the following to your .emacs:
(setq font-latex-fontify-sectioning 'color)
Edit
Here is the config I usually use to customise the AUCTeX formatting:
;; Only change sectioning colour
(setq font-latex-fontify-sectioning 'color)
;; super-/sub-script on baseline
(setq font-latex-script-display (quote (nil)))
;; Do not change super-/sub-script font
(custom-set-faces
'(font-latex-subscript-face ((t nil)))
'(font-latex-superscript-face ((t nil)))
)
;; Exclude bold/italic from keywords
(setq font-latex-deactivated-keyword-classes
'("italic-command" "bold-command" "italic-declaration" "bold-declaration"))
If you find a solution to this, the beers are on me. The best I've been able to come up with so far is to put the following in my .emacs somewhere and run the function after loading a mode that does this (org-mode does it too).
(defun fix-fonts ()
(interactive)
(mapc
(lambda (face)
(set-face-attribute face nil
;; :family (if (string= system-type "darwin")
;; "Menlo"
;; "Inconsolata")
:width 'normal
:height 1.0
:weight 'normal
:underline nil
:slant 'normal))
(remove 'default (face-list))))
I don't do the family thing anymore, because I didn't have time to figure out a good way to programatically get it right and it doesn't seem to matter, but your mileage might vary. Also, I don't set anything on the "default" font because some of the other values are relative and need that fixed reference point.

Unreadable buffer names in Emacs 23.2

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).

Turn off anti-alias for font in Emacs 23

How to I disable anti-aliasing for fonts in the Windows version of Emacs 23?
Thanks.
You can specify the antialias=none option for your fonts, as stated in GNU Emacs Manual
As I couldn't find a satisfactory answer to this one for a long time, I thought it wouldn't hurt to add this link to this discussion, as the above does not generally work on Linux:
http://keyboardconnoisseur.blogspot.com/2011/04/turning-off-antialiasing-for-specific.html
The problem is that under Linux, emacs doesn't seem to be doing a lot of font handling at all, and you need to disable the antialiasing elsewhere.
If others were searching for how to disable anti-aliasing in OS X, you can run
defaults write org.gnu.Emacs AppleAntiAliasingThreshold 999
Never have run Mac OS X, so usable only for Linux + Windows:
(defvar my-preferred-font
(cond
((eq window-system 'x)
"-misc-fixed-medium-r-normal--14-*-*-*-c-*-iso10646-1")
((eq window-system 'w32)
"Courier New-10:antialias=none")
(t nil)))
(when my-preferred-font
(set-frame-font my-preferred-font)
(set-fontset-font "fontset-default" 'latin my-preferred-font)
(set-fontset-font "fontset-default" 'phonetic my-preferred-font)
(set-fontset-font "fontset-default" 'cyrillic my-preferred-font)
(set-fontset-font "fontset-default" 'greek my-preferred-font))
Whose uses only ASCII it is enough to follow official suggestion:
(add-to-list 'default-frame-alist '(font . "Courier New-10:antialias=none"))
I work with cyrillic, greek and IPA texts so need to define defaults for fontsets...