[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple Size faces in one document

From: Eric Marsden
Subject: Re: Multiple Size faces in one document
Date: Tue, 04 Feb 2003 14:58:31 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.2

>>>>> "tsa" == Thomas S Atkins <> writes:

  tsa> I am trying to do the above in Emacs version 21.2.1 and I can
  tsa> not find the information in the manual. Is this possible?

since v21, the display engine in Emacs is able to display different
font sizes. However, only a few elisp libraries have been updated to
take advantage of this functionality. Luckily it's pretty easy to add
support to enriched-mode.

Try loading the following code and using enriched-mode. This adds
basic support for the <bigger> and <smaller> tags in the text/enriched
format (RFC1896). To make text in the region larger, use "M-g +"; to
make it smaller, use "M-g -".

This code doesn't handle nested sizing tags correctly; stuff like


is handled like <bigger>foo</bigger>.

(require 'enriched)

(let ((display-translations (assq 'display enriched-translations)))
  (setcdr display-translations
          '(((height (+ 2)) "bigger")
            ((height (- 2)) "smaller")
            (nil enriched-handle-display-prop))))

(put 'display 'format-list-valued nil)

(defun facemenu-set-bigger (start end)
  (interactive "r")
  (add-text-properties start end '(display (height (+ 2)))))

(defun facemenu-set-smaller (start end)
  (interactive "r")
  (add-text-properties start end '(display (height (- 2)))))

(define-key facemenu-keymap [?+] 'facemenu-set-bigger)
(define-key facemenu-keymap [?-] 'facemenu-set-smaller)

Eric Marsden                          <URL:>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]