> Add the specifier for the font name using a tag set. i.e. the x font
> name gets added with an 'x tag set and the windows font name with an
> 'mswindows tag set.
>
> This should work giving the following excerpt from the info file
>
> * The inst-pairs contained in the specification that was found are
> considered in their order in the inst-list, looking for one whose
> tag set matches the device that is derived from the window domain.
> (The tag set is an unordered list of zero or more tag symbols.
> For all tags that have predicates associated with them, the
> predicate must match the device.)
>
> Jan
Ok, the following seems to work for me.
PLEASE, look at this very carefully, I honestly don't understand specifiers,
and I'm just winging it....
smithers% diff -u faces.el.orig faces.el
--- faces.el.orig Wed Feb 17 17:19:23 1999
+++ faces.el Wed Feb 17 17:16:39 1999
@@ -794,7 +794,7 @@
;; WE DEMAND LEXICAL SCOPING!!!
;; WE DEMAND LEXICAL SCOPING!!!
;; WE DEMAND LEXICAL SCOPING!!!
-(defun frob-face-property (face property func &optional locale)
+(defun frob-face-property (face property func func-tag &optional locale)
"Change the specifier for FACE's PROPERTY according to FUNC, in LOCALE.
This function is ugly and messy and is primarily used as an internal
helper function for `make-face-bold' et al., so you probably don't
@@ -802,6 +802,7 @@
FUNC should be a function of two arguments (an instance and a device)
that returns a modified name that is valid for the given device.
+FUNC-TAG gives the device type that FUNC should be applied to.
If LOCALE specifies a valid domain (i.e. a window, frame, or device),
this function instantiates the specifier over that domain, applies FUNC
to the resulting instance, and adds the result back as an instantiator
@@ -820,7 +821,7 @@
(let* ((inst (face-property-instance face property locale))
(name (and inst (funcall func inst (dfw-device locale)))))
(when name
- (add-spec-to-specifier sp name locale)))
+ (add-spec-to-specifier sp name locale (list func-tag))))
;; otherwise, map over all specifications ...
;; but first, some further kludging:
;; (1) if we're frobbing the global property, make sure
@@ -849,10 +850,12 @@
;; Otherwise map frob-face-property-1 over each device.
(result
(if device
- (list (frob-face-property-1 sp device inst-list func))
+ (list (frob-face-property-1 sp device inst-list func
+ func-tag))
(mapcar (lambda (device)
(frob-face-property-1 sp device
- inst-list func))
+ inst-list func
+ func-tag))
(device-list))))
new-result)
;; remove duplicates and nils from the obtained list of
@@ -868,7 +871,7 @@
locale
func))))
-(defun frob-face-property-1 (sp device inst-list func)
+(defun frob-face-property-1 (sp device inst-list func func-tag)
(let
(first-valid result)
(while (and inst-list (not result))
@@ -880,7 +883,8 @@
(progn
(if (not first-valid)
(setq first-valid inst-pair))
- (setq result (funcall func sp-inst device))
+ (setq result (and (eq func-tag (device-type device))
+ (funcall func sp-inst device)))
(if result
(setq result (cons tag-set result))))))
(setq inst-list (cdr inst-list)))
@@ -973,9 +977,10 @@
(lambda ()
;; handle X specific entries
(when (featurep 'x)
- (frob-face-property face 'font 'x-make-font-bold locale))
+ (frob-face-property face 'font 'x-make-font-bold 'x locale))
(when (featurep 'mswindows)
- (frob-face-property face 'font 'mswindows-make-font-bold locale))
+ (frob-face-property face 'font 'mswindows-make-font-bold
+ 'mswindows locale))
)
'(([default] . [bold])
([bold] . t)
@@ -998,9 +1003,10 @@
(lambda ()
;; handle X specific entries
(when (featurep 'x)
- (frob-face-property face 'font 'x-make-font-italic locale))
+ (frob-face-property face 'font 'x-make-font-italic 'x locale))
(when (featurep 'mswindows)
- (frob-face-property face 'font 'mswindows-make-font-italic locale))
+ (frob-face-property face 'font 'mswindows-make-font-italic
+ 'mswindows locale))
)
'(([default] . [italic])
([bold] . [bold-italic])
@@ -1024,9 +1030,10 @@
(lambda ()
;; handle X specific entries
(when (featurep 'x)
- (frob-face-property face 'font 'x-make-font-bold-italic locale))
+ (frob-face-property face 'font 'x-make-font-bold-italic 'x locale))
(when (featurep 'mswindows)
- (frob-face-property face 'font 'mswindows-make-font-bold-italic locale))
+ (frob-face-property face 'font 'mswindows-make-font-bold-italic
+ 'mswindows locale))
)
'(([default] . [italic])
([bold] . [bold-italic])
@@ -1049,9 +1056,10 @@
(lambda ()
;; handle X specific entries
(when (featurep 'x)
- (frob-face-property face 'font 'x-make-font-unbold locale))
+ (frob-face-property face 'font 'x-make-font-unbold 'x locale))
(when (featurep 'mswindows)
- (frob-face-property face 'font 'mswindows-make-font-unbold locale))
+ (frob-face-property face 'font 'mswindows-make-font-unbold
+ 'mswindows locale))
)
'(([default] . t)
([bold] . [default])
@@ -1074,9 +1082,10 @@
(lambda ()
;; handle X specific entries
(when (featurep 'x)
- (frob-face-property face 'font 'x-make-font-unitalic locale))
+ (frob-face-property face 'font 'x-make-font-unitalic 'x locale))
(when (featurep 'mswindows)
- (frob-face-property face 'font 'mswindows-make-font-unitalic locale))
+ (frob-face-property face 'font 'mswindows-make-font-unitalic
+ 'mswindows locale))
)
'(([default] . t)
([bold] . t)
@@ -1095,9 +1104,10 @@
(interactive (list (read-face-name "Shrink which face: ")))
;; handle X specific entries
(when (featurep 'x)
- (frob-face-property face 'font 'x-find-smaller-font locale))
+ (frob-face-property face 'font 'x-find-smaller-font 'x locale))
(when (featurep 'mswindows)
- (frob-face-property face 'font 'mswindows-find-smaller-font locale)))
+ (frob-face-property face 'font 'mswindows-find-smaller-font
+ 'mswindows locale)))
(defun make-face-larger (face &optional locale)
"Make the font of FACE be larger, if possible.
@@ -1105,9 +1115,10 @@
(interactive (list (read-face-name "Enlarge which face: ")))
;; handle X specific entries
(when (featurep 'x)
- (frob-face-property face 'font 'x-find-larger-font locale))
+ (frob-face-property face 'font 'x-find-larger-font 'x locale))
(when (featurep 'mswindows)
- (frob-face-property face 'font 'mswindows-find-larger-font locale)))
+ (frob-face-property face 'font 'mswindows-find-larger-font
+ 'mswindows locale)))
(defun invert-face (face &optional locale)
"Swap the foreground and background colors of the face."