tags:

views:

42

answers:

1

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

How can I change the font of elements between html tags (or disable italics, bold, etc.)?

+1  A: 

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))
liwp
Thanks it worked. I still don't understand most of emacs terminology such as face-list, lambda, slant, etc.
janoChen
In the above lambda defines an anonymous function that takes one argument - face. That function is then applied to each element returned by the function call (face-list) by the mapc function. Finally, the body of the anonymous function calls set-face-attribute on the given face, setting attributes for that face. A face in emacs-speak is a font used in a specific semantic context, e.g. to highlight the contents of a h2 html tag in this case. A face has properties like font, size, weight, slant and so on. You can access the documentation of functions with C-h f <fn name>.
liwp