help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to set the font of a region?


From: Kevin Rodgers
Subject: Re: How to set the font of a region?
Date: Thu, 29 Jul 2004 08:51:40 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Pascal Bourguignon wrote:
> I tried this (on X, emacs 21.3.1):
>
> (let* ((default-font "-*-console-medium-r-normal-*-16-*-*-*-*-*-*-*")
>        (default-face (gensym "face")))
>   (make-face default-face)
>   (set-face-font default-face default-font)
>   (dolist (font font-list)
>     (let ((face (gensym "face")))
>       (make-face face)
>       (set-face-font face font)
>       (let ((start (point)))
>         (insert font)
>         (insert "\n")
>         (facemenu-add-face 'default start (point))
>         (facemenu-set-face default-face start (point)))
>       (let ((start (point)))
>         (insert "The lazy dog jumped over the fast fox! (let [it {be} and] say) 
no.more;\n")
>         (facemenu-add-face 'default start (point))
>         (facemenu-set-face face start (point))))))
>
> -->
>
> --international-medium-r-normal--15-150-72-72-m-90-iso8859-1
> The lazy dog jumped over the fast fox! (let [be {it} and] say) no.more;
> --iris-medium-r-normal--10-100-72-72-m-60-iso8859-1
> The lazy dog jumped over the fast fox! (let [be {it} and] say) no.more;
> --iris-medium-r-normal--12-120-72-72-m-80-iso8859-1
> The lazy dog jumped over the fast fox! (let [be {it} and] say) no.more;
> --iris-medium-r-normal--13-130-72-72-m-90-iso8859-1
> The lazy dog jumped over the fast fox! (let [be {it} and] say) no.more;
> ...
>
>
> but all the text generated keeps the same default font.  Why my
> facemenu-set-face calls are without effect?

I don't know.  Does it help to use an interned symbol for the face?
i.e. change (gensym "face") to (gentemp "face") after (require 'cl).

--
Kevin Rodgers



reply via email to

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