Tomorrow theme for Emacs shows Chinese charaters as blocks - emacs

I installed Tomorrow theme into my Emacs24 using melpa.
Chinese characters appeared as blocks in comments while showing the correct characters in other places.
The default font in my .emacs is like following:
(set-default-font "Menlo-12")
(setq default-frame-alist '(font . "Menlo-12"))

It seems like the Menlo font doesn't support italic Chinese characters. Type M-x customize-face RET font-lock-comment-face and change "slant" to "normal", and the characters should appear.

Related

Display all unicode characters in Emacs under OS X

First of all, please look at this screenshot
I have GUI Emacs installed via Homebrew on the left and another one running inside iTerm2 with -nw option on the right. Both of them are using Droid Sans Mono font.
But, as you can see, the right one can perfectly handle all unicode characters. I think iTerm2 helps here:
on the left display says that there is no font available
on the right display is equal to terminal code #xF0 #x9F #x8D #xBA
How can I achieve the same result in GUI Emacs as I can have in iTerm2?
OK, I finally managed this issue with these lines in my emacs config:
;; set proper language (fixes cyrillic letters in ansi-term)
(setenv "LANG" "ru_RU.UTF-8")
;; default font
(set-face-attribute 'default nil :family "Droid Sans Mono")
;; font for all unicode characters
(set-fontset-font t 'unicode "Symbola" nil 'prepend)
;; override font for cyrillic characters
(set-fontset-font t 'cyrillic "Droid Sans Mono")
The first line can be ignored, as it only for fixing cyrillic letters in ansi-term.
The steps are:
set your default font with set-face-attribute
then set different font for the specific character-sets via set-fontset-font
Of course, I'll need to set specific range of characters for Symbola font, but it works for me now.
P.S. but I still can't get colored emoji in Emacs as I have in iTerm2

Emacs `Invalid font name`

I am using GNU Emacs 24.3.1 (x86_64-suse-linux-gnu, GTK+ Version 3.6.4). I have custom font Inconsolata-g in my ~/.fonts folder, and I have set it as Monospace font in ~/.config/fontconfig/fonts.conf. It works well except Emacs is giving me error: Invalid font name, -unknown-Inconsolata-g-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1 at launch.
If I change monospace font, then Emacs launch without problem, but when I do M-x set-default-font, and select -unknown-Inconsolata-g-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1, I also get Invalid font name: "-unknown-Inconsolata-g-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1".
How could i fix this?
Thanks to Peter Dyballa (http://lists.gnu.org/archive/html/help-gnu-emacs/2013-06/msg00347.html), I fixed this with the following in my ~/.emacs:
(setq initial-frame-alist '(
(font . "Monospace-10")
))
(setq default-frame-alist '(
(font . "Monospace-10")
))
(I have set Monospace to Inconsolata-g in my system settings)

Emacs codepage problems: Terminus font, utf-8 and cyrillic-translit input

I love the cyrillic-translit input method for Emacs. However, after I set the wonderful Terminus as my default font, the Russian characters appear in Arial or something (in any case it's not Terminus).
How do I fix this? Setting the default font to UTF-8 (Emacs equivalent "-outline-Terminus-normal-normal-normal-mono-16-*-*-*-c-*-iso10646-1") doesn't help. I guess this possibly means that Terminus lacks decent UTF-8 support?
Anyhow, I'm using the following snippet for switching between cyrillic-translit input method and the "normal" mode:
(defun toggle-cyrillic-input-method ()
"toggle between French and no input method"
(interactive)
(if (string= current-input-method "cyrillic-translit")
(set-input-method nil)
(set-input-method "cyrillic-translit")))
(global-set-key [f9] 'toggle-cyrillic-input-method)
Now -- is there a way to make the snippet not only switch over to cyrillic-translit but also switch the codepage when I press F9?
In other words, how do I make it also toggle the font between "-outline-Terminus-normal-normal-normal-mono-16-*-*-*-c-*-iso8859-1" (Latin) and "-outline-Terminus-normal-normal-normal-mono-16-*-*-*-c-*-iso8859-5" (Russian)?
It's the only workaround I (as a non-programmer) could think of. Any other ideas are welcome, too. Thanks!

Overriding Emacs 23 font substitutions

I use emacs with org-mode and other packages that assume all characters have the same width. This was not problematic until I started using Emacs 23 (on Mac and Linux) instead of Carbon Emacs. Now many non-ASCII characters (such as the phonetic characters in 0250–02AF) are rendered with a different font with different metrics. I would like to force emacs to render these characters with the same font as ASCII characters, e.g. DejaVu Sans Mono 10. How can this be achieved? Where is the documentation relating to emacs fonts in never versions located?
Try
(set-fontset-font
nil '(#x0250 . #x02af) (font-spec :family "DejaVu Sans Mono"))
You can move the cursor (point) over the phonetic character and do a C-u C-x = to run some version of what-cursor-position. This will open another buffer containing information about what is under the cursor - including a line containing face and a descriptionof what face is used. Remeber the name of the face used.
Then, call M-x customize-face and enter the remembered used face and customize it to your needs.

How can I change fonts of elements between HTML tags in Emacs?

I have this in my .emacs: (set-frame-font "Consolas-10")
and I also tried this: (set-frame-font "Consolas-10")
But the font between the <h2>tags are not Consolas (or maybe Italic Consolas):
alt text http://img10.imageshack.us/img10/6865/emacs2.jpg
How can I change the font of elements between html tags (or disable italics, bold, etc.)?
Looking at your earlier question it seems to me that you should be able to use the same idea and simply disable the use of italics on font faces (include all the other setting from that other question if you want to disable bold and underline as well):
(mapc
(lambda (face)
(set-face-attribute face nil :slant 'normal))
(face-list))