diff options
| author | Kenichi Handa | 2008-06-13 01:56:55 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-06-13 01:56:55 +0000 |
| commit | fcea6e2376a8f3912c6f261d75f69ce3ba8eee45 (patch) | |
| tree | 8f1b9bb05841cb6a6b4e88041a2b5ca5ed644da7 | |
| parent | d434fef5e980430a1e927b12dc10fb773e8e96ea (diff) | |
| download | emacs-fcea6e2376a8f3912c6f261d75f69ce3ba8eee45.tar.gz emacs-fcea6e2376a8f3912c6f261d75f69ce3ba8eee45.zip | |
(set-face-attribute): Parse "FOUNDRY-FAMILY" form here.
| -rw-r--r-- | lisp/faces.el | 69 |
1 files changed, 50 insertions, 19 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index 0fa55f8bd89..87fa61db53c 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -272,6 +272,7 @@ If FRAME is omitted or nil, use the selected frame." | |||
| 272 | 272 | ||
| 273 | (defcustom face-x-resources | 273 | (defcustom face-x-resources |
| 274 | '((:family (".attributeFamily" . "Face.AttributeFamily")) | 274 | '((:family (".attributeFamily" . "Face.AttributeFamily")) |
| 275 | (:foundry (".attributeFoundry" . "Face.AttributeFoundry")) | ||
| 275 | (:width (".attributeWidth" . "Face.AttributeWidth")) | 276 | (:width (".attributeWidth" . "Face.AttributeWidth")) |
| 276 | (:height (".attributeHeight" . "Face.AttributeHeight")) | 277 | (:height (".attributeHeight" . "Face.AttributeHeight")) |
| 277 | (:weight (".attributeWeight" . "Face.AttributeWeight")) | 278 | (:weight (".attributeWeight" . "Face.AttributeWeight")) |
| @@ -583,6 +584,12 @@ VALUE must be a string specifying the font family, e.g. ``courier'', | |||
| 583 | or a fontset alias name. If a font family is specified, wild-cards `*' | 584 | or a fontset alias name. If a font family is specified, wild-cards `*' |
| 584 | and `?' are allowed. | 585 | and `?' are allowed. |
| 585 | 586 | ||
| 587 | `:foundry' | ||
| 588 | |||
| 589 | VALUE must be a string specifying the font foundry, | ||
| 590 | e.g. ``adobe''. If a font foundry is specified, wild-cards `*' | ||
| 591 | and `?' are allowed. | ||
| 592 | |||
| 586 | `:width' | 593 | `:width' |
| 587 | 594 | ||
| 588 | VALUE specifies the relative proportionate width of the font to use. | 595 | VALUE specifies the relative proportionate width of the font to use. |
| @@ -670,8 +677,9 @@ HEIGHT DATA) where WIDTH and HEIGHT are the size in pixels, and DATA | |||
| 670 | is a string containing the raw bits of the bitmap. VALUE nil means | 677 | is a string containing the raw bits of the bitmap. VALUE nil means |
| 671 | explicitly don't use a stipple pattern. | 678 | explicitly don't use a stipple pattern. |
| 672 | 679 | ||
| 673 | For convenience, attributes `:family', `:width', `:height', `:weight', | 680 | For convenience, attributes `:family', `:foundry', `:width', |
| 674 | and `:slant' may also be set in one step from an X font name: | 681 | `:height', `:weight', and `:slant' may also be set in one step |
| 682 | from an X font name: | ||
| 675 | 683 | ||
| 676 | `:font' | 684 | `:font' |
| 677 | 685 | ||
| @@ -697,9 +705,19 @@ like an underlying face would be, with higher priority than underlying faces." | |||
| 697 | ;; Don't recursively set the attributes from the frame's font param | 705 | ;; Don't recursively set the attributes from the frame's font param |
| 698 | ;; when we update the frame's font param fro the attributes. | 706 | ;; when we update the frame's font param fro the attributes. |
| 699 | (let ((inhibit-face-set-after-frame-default t)) | 707 | (let ((inhibit-face-set-after-frame-default t)) |
| 700 | (internal-set-lisp-face-attribute face (car args) | 708 | (if (and (eq (car args) :family) |
| 701 | (purecopy (cadr args)) | 709 | (string-match "\\([^-]*\\)-\\([^-]*\\)" (cadr args))) |
| 702 | where)) | 710 | (let ((foundry (match-string 1 (cadr args))) |
| 711 | (family (match-string 2 (cadr args)))) | ||
| 712 | (internal-set-lisp-face-attribute face :foundry | ||
| 713 | (purecopy foundry) | ||
| 714 | where) | ||
| 715 | (internal-set-lisp-face-attribute face :family | ||
| 716 | (purecopy family) | ||
| 717 | where)) | ||
| 718 | (internal-set-lisp-face-attribute face (car args) | ||
| 719 | (purecopy (cadr args)) | ||
| 720 | where))) | ||
| 703 | (setq args (cdr (cdr args)))))) | 721 | (setq args (cdr (cdr args)))))) |
| 704 | 722 | ||
| 705 | 723 | ||
| @@ -749,8 +767,9 @@ Use `set-face-attribute' for finer control of font weight and slant." | |||
| 749 | (defun set-face-font (face font &optional frame) | 767 | (defun set-face-font (face font &optional frame) |
| 750 | "Change font-related attributes of FACE to those of FONT (a string). | 768 | "Change font-related attributes of FACE to those of FONT (a string). |
| 751 | FRAME nil or not specified means change face on all frames. | 769 | FRAME nil or not specified means change face on all frames. |
| 752 | This sets the attributes `:family', `:width', `:height', `:weight', | 770 | This sets the attributes `:family', `:foundry', `:width', |
| 753 | and `:slant'. When called interactively, prompt for the face and font." | 771 | `:height', `:weight', and `:slant'. When called interactively, |
| 772 | prompt for the face and font." | ||
| 754 | (interactive (read-face-and-attribute :font)) | 773 | (interactive (read-face-and-attribute :font)) |
| 755 | (set-face-attribute face frame :font font)) | 774 | (set-face-attribute face frame :font font)) |
| 756 | 775 | ||
| @@ -954,6 +973,8 @@ an integer value." | |||
| 954 | (font-family-list)) | 973 | (font-family-list)) |
| 955 | ;; Only one font on TTYs. | 974 | ;; Only one font on TTYs. |
| 956 | (list (cons "default" "default")))) | 975 | (list (cons "default" "default")))) |
| 976 | (:foundry | ||
| 977 | (list nil)) | ||
| 957 | (:width | 978 | (:width |
| 958 | (mapcar #'(lambda (x) (cons (symbol-name (car x)) (car x))) | 979 | (mapcar #'(lambda (x) (cons (symbol-name (car x)) (car x))) |
| 959 | font-width-table)) | 980 | font-width-table)) |
| @@ -1001,6 +1022,7 @@ an integer value." | |||
| 1001 | 1022 | ||
| 1002 | (defvar face-attribute-name-alist | 1023 | (defvar face-attribute-name-alist |
| 1003 | '((:family . "font family") | 1024 | '((:family . "font family") |
| 1025 | (:foundry . "font foundry") | ||
| 1004 | (:width . "character set width") | 1026 | (:width . "character set width") |
| 1005 | (:height . "height in 1/10 pt") | 1027 | (:height . "height in 1/10 pt") |
| 1006 | (:weight . "weight") | 1028 | (:weight . "weight") |
| @@ -1288,6 +1310,7 @@ If FRAME is t, report on the defaults for face FACE (for new frames). | |||
| 1288 | If FRAME is omitted or nil, use the selected frame." | 1310 | If FRAME is omitted or nil, use the selected frame." |
| 1289 | (interactive (list (read-face-name "Describe face" "= `default' face" t))) | 1311 | (interactive (list (read-face-name "Describe face" "= `default' face" t))) |
| 1290 | (let* ((attrs '((:family . "Family") | 1312 | (let* ((attrs '((:family . "Family") |
| 1313 | (:foundry . "Foundry") | ||
| 1291 | (:width . "Width") | 1314 | (:width . "Width") |
| 1292 | (:height . "Height") | 1315 | (:height . "Height") |
| 1293 | (:weight . "Weight") | 1316 | (:weight . "Weight") |
| @@ -1978,19 +2001,27 @@ Value is the new frame created." | |||
| 1978 | "Set frame-local faces of FRAME from face specs and resources. | 2001 | "Set frame-local faces of FRAME from face specs and resources. |
| 1979 | Initialize colors of certain faces from frame parameters." | 2002 | Initialize colors of certain faces from frame parameters." |
| 1980 | (unless inhibit-face-set-after-frame-default | 2003 | (unless inhibit-face-set-after-frame-default |
| 1981 | (if (face-attribute 'default :font t) | 2004 | (or (eq (face-attribute 'default :font t) 'unspecified) |
| 1982 | (set-face-attribute 'default frame :font | 2005 | (set-face-attribute 'default frame :font |
| 1983 | (face-attribute 'default :font t)) | 2006 | (face-attribute 'default :font t))) |
| 1984 | (set-face-attribute 'default frame :family | 2007 | (or (eq (face-attribute 'default :family t) 'unspecified) |
| 1985 | (face-attribute 'default :family t)) | 2008 | (set-face-attribute 'default frame :family |
| 1986 | (set-face-attribute 'default frame :height | 2009 | (face-attribute 'default :family t))) |
| 1987 | (face-attribute 'default :height t)) | 2010 | (or (eq (face-attribute 'default :foundry t) 'unspecified) |
| 1988 | (set-face-attribute 'default frame :slant | 2011 | (set-face-attribute 'default frame :foundry |
| 1989 | (face-attribute 'default :slant t)) | 2012 | (face-attribute 'default :foundry t))) |
| 1990 | (set-face-attribute 'default frame :weight | 2013 | (or (eq (face-attribute 'default :height t) 'unspecified) |
| 1991 | (face-attribute 'default :weight t)) | 2014 | (set-face-attribute 'default frame :height |
| 1992 | (set-face-attribute 'default frame :width | 2015 | (face-attribute 'default :height t))) |
| 1993 | (face-attribute 'default :width t)))) | 2016 | (or (eq (face-attribute 'default :slant t) 'unspecified) |
| 2017 | (set-face-attribute 'default frame :slant | ||
| 2018 | (face-attribute 'default :slant t))) | ||
| 2019 | (or (eq (face-attribute 'default :weight t) 'unspecified) | ||
| 2020 | (set-face-attribute 'default frame :weight | ||
| 2021 | (face-attribute 'default :weight t))) | ||
| 2022 | (or (eq (face-attribute 'default :width t) 'unspecified) | ||
| 2023 | (set-face-attribute 'default frame :width | ||
| 2024 | (face-attribute 'default :width t)))) | ||
| 1994 | ;; Find attributes that should be initialized from frame parameters. | 2025 | ;; Find attributes that should be initialized from frame parameters. |
| 1995 | (let ((face-params '((foreground-color default :foreground) | 2026 | (let ((face-params '((foreground-color default :foreground) |
| 1996 | (background-color default :background) | 2027 | (background-color default :background) |