aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1993-05-26 19:42:36 +0000
committerJim Blandy1993-05-26 19:42:36 +0000
commit10d89673923e14a72b6dc2a6e574221b6f3665eb (patch)
tree65f1e6c5b14c987a068ffd33f6a05ef32499f9e5
parent79161a452a16a8446448c598b8afd8cf7511bff6 (diff)
downloademacs-10d89673923e14a72b6dc2a6e574221b6f3665eb.tar.gz
emacs-10d89673923e14a72b6dc2a6e574221b6f3665eb.zip
* faces.el (x-resolve-font-name): If PATTERN is nil, return the
frame's face. (set-face-font): Only use x-resolve-font-name if FONT is a string. Copying a faces shouldn't resolve the font.
-rw-r--r--lisp/faces.el24
1 files changed, 14 insertions, 10 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index ee603321460..a0359e6d055 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -85,8 +85,8 @@ Otherwise report on the defaults for face FACE (for new frames)."
85If the optional FRAME argument is provided, change only 85If the optional FRAME argument is provided, change only
86in that frame; otherwise change each frame." 86in that frame; otherwise change each frame."
87 (interactive (internal-face-interactive "font")) 87 (interactive (internal-face-interactive "font"))
88 (internal-set-face-1 face 'font (x-resolve-font-name font face frame) 88 (if (stringp font) (setq font (x-resolve-font-name font face frame)))
89 3 frame)) 89 (internal-set-face-1 face 'font font 3 frame))
90 90
91(defsubst set-face-foreground (face color &optional frame) 91(defsubst set-face-foreground (face color &optional frame)
92 "Change the foreground color of face FACE to COLOR (a string). 92 "Change the foreground color of face FACE to COLOR (a string).
@@ -416,15 +416,19 @@ set its foreground and background to the default background and foreground."
416(defun x-resolve-font-name (pattern &optional face frame) 416(defun x-resolve-font-name (pattern &optional face frame)
417 "Return a font name matching PATTERN. 417 "Return a font name matching PATTERN.
418All wildcards in PATTERN become substantiated. 418All wildcards in PATTERN become substantiated.
419If PATTERN is nil, return the name of the frame's base font, which never
420contains wildcards.
419Given optional arguments FACE and FRAME, try to return a font which is 421Given optional arguments FACE and FRAME, try to return a font which is
420also the same size as FACE on FRAME," 422also the same size as FACE on FRAME."
421 (let ((fonts (x-list-fonts pattern face frame))) 423 (if pattern
422 (or fonts 424 (let ((fonts (x-list-fonts pattern face frame)))
423 (if face 425 (or fonts
424 (error "no fonts match `%S'." pattern) 426 (if face
425 (error "no fonts matching pattern are the same size as `%s'." 427 (error "no fonts match `%S'." pattern)
426 pattern face))) 428 (error "no fonts matching pattern are the same size as `%s'."
427 (car fonts))) 429 pattern face)))
430 (car fonts))
431 (cdr (assq 'font (frame-parameters (selected-frame))))))
428 432
429(defun x-frob-font-weight (font which) 433(defun x-frob-font-weight (font which)
430 (if (or (string-match x-font-regexp font) 434 (if (or (string-match x-font-regexp font)