--On Saturday, July 28, 2001 11:13 PM +0900 "Stephen J. Turnbull"
<turnbull(a)sk.tsukuba.ac.jp> wrote:
>>>>> "Mike" == Mike Alexander
<mta(a)arbortext.com> writes:
Mike> I traced through the code for a while but couldn't find
Mike> anywhere that the type is checked against the type of device
Mike> being used, but the code is complex and I probably missed
Mike> it.
No, you probably didn't miss it. Much of the functionality alleged to
be in Custom is not.
Have you tried directly setting the specifier using set-face-font?
No, I haven't tried that, but before I saw your message, I spent part of
today looking into this and found what looks like a bug in
custom-set-face-font-size and custom-set-face-font-family. If they are
ever called with a non-null "locale" parameter (such as a frame) they fail
because the last parameter to apply must be a list and they pass the locale
parameter directly. I'm not sure why they are using apply to call
face-font-name, but the attached patch fixes this. With this patch you can
do something like the following sequence of calls and it will work.
(custom-set-faces
'(default ((((type msprinter)) (:size "8pt" :family "Courier
New"))
(t (:size "9pt" :family "Lucida Console"))
)
))
(setq pf (make-frame nil (Printer-get-device)))
(face-property-instance 'default 'font pf)
Apparently the call to custom-set-face-font-{size|family} is being made in
a context where errors are being trapped and silently ignored which is why
no one noticed that they were failing.
Mike Alexander <mailto:mta@arbortext.com>
Arbortext, Inc. +1-734-997-0200
2001-07-29 Mike Alexander <mta(a)arbortext.com>
* cus-face.el (custom-set-face-font-size): Last arg to apply is a
list
(custom-set-face-font-family): ditto
Index: cus-face.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/cus-face.el,v
retrieving revision 1.9
diff -u -r1.9 cus-face.el
--- cus-face.el 2001/04/12 18:21:15 1.9
+++ cus-face.el 2001/07/29 06:39:11
@@ -202,7 +202,7 @@
(defun custom-set-face-font-size (face size &optional locale tags)
"Set the font of FACE to SIZE."
- (let* ((font (apply 'face-font-name face locale))
+ (let* ((font (apply 'face-font-name face (list locale)))
;; Gag
(fontobj (font-create-object font)))
(set-font-size fontobj size)
@@ -217,7 +217,7 @@
(defun custom-set-face-font-family (face family &optional locale tags)
"Set the font of FACE to FAMILY."
- (let* ((font (apply 'face-font-name face locale))
+ (let* ((font (apply 'face-font-name face (list locale)))
;; Gag
(fontobj (font-create-object font)))
(set-font-family fontobj family)