emacs-devel
[Top][All Lists]
Advanced

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

Re: Bold by moving pixels problem


From: Miles Bader
Subject: Re: Bold by moving pixels problem
Date: 17 Dec 2002 14:00:09 +0900

I've attached a patch below that's implements the `final face
realization filtering' function that bob wanted.  This is just a
first-cut, so I'd appreciate any comments people have.

The basic interface is a variable, `realize-face-filter':

   realize-face-filter's value is nil

   If non-nil, a function called to perturb faces before final realization.
   It is passed a lisp-vector containing all the attributes of the
   fully-specified face, and can change any that it wishes.

For instance the following will completely turn off bold fonts:

   (defun unboldify-lface (lface)
     (aset lface 4 'normal))
   (setq realize-face-filter 'unboldify-lface)
   (clear-face-cache)

It seems to work fine.

If I instrument the filter function a bit, like:

   (defvar ubf-count 0)
   (defun unboldify-lface (lface)
     (setq ubf-count (1+ ubf-count))
     (aset lface 4 'normal))
   (setq realize-face-filter 'unboldify-lface)
   (clear-face-cache)

`ubf-count' seems to continually incremented (if I keep checking in
*scratch* it goes up 2 or 3 each time, but if I display a complicated
new buffer, it can go up by 100).  It doesn't seem noticably slow to me,
but I have a reasonably fast cpu (1GHz).

I guess I'll need to see exactly what it's getting called on, but this
suggests that maybe more places should be checking the face cache
(or that the face-cache checking should be moved into realize_face).
[Gerd, are you listening...?]

Also, perhaps `realize-face-filter' should be a list of functions
instead, e.g., `realize-face-filter-functions', as there might be
circumstances when two entities want to add a filter -- but maybe this
is something that will only ever be changed by the end-user, who can
make his own filter function do everything he wants.

Any comments?

Thanks,

-Miles

Patch:


Attachment: realize-face-filter-20021217.patch
Description: realize-face-filter-20021217.patch


-- 
[|nurgle|]  ddt- demonic? so quake will have an evil kinda setting? one that 
            will  make every christian in the world foamm at the mouth? 
[iddt]      nurg, that's the goal 

reply via email to

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