all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Marsden <emarsden@laas.fr>
Subject: Re: Multiple Size faces in one document
Date: Tue, 04 Feb 2003 14:58:31 +0100	[thread overview]
Message-ID: <wzid6m8p2pk.fsf@melbourne.laas.fr> (raw)
In-Reply-To: pan.2003.02.03.21.17.35.236455@aug.com

>>>>> "tsa" == Thomas S Atkins <tatkins@aug.com> 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

   <bigger><bigger>foo</bigger></bigger>

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:http://www.laas.fr/~emarsden/>

  parent reply	other threads:[~2003-02-04 13:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-03 21:17 Multiple Size faces in one document Thomas S. Atkins
2003-02-04  6:33 ` Kai Großjohann
2003-02-04 17:09   ` Thomas S. Atkins
2003-02-04  7:30 ` Tim X
2003-02-04 13:58 ` Eric Marsden [this message]
2003-02-04 17:08   ` Thomas S. Atkins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wzid6m8p2pk.fsf@melbourne.laas.fr \
    --to=emarsden@laas.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.