update.
[chise/xemacs-chise.git.1] / lisp / cus-face.el
index 36e2d32..5cb6699 100644 (file)
@@ -55,6 +55,7 @@
 
 ;;; Font Attributes.
 
+;; Consider adding the stuff in the XML font model here.
 (defconst custom-face-attributes
   '((:foreground (color :tag "Foreground"
                        :value ""
@@ -98,18 +99,20 @@ Control whether the text should be strikethru.")
                            :help-echo "\
 Control whether the text should be inverted.  Works only on TTY-s")
                    set-face-reverse-p face-reverse-p))
-  "Alist of face attributes. 
+  "Alist of face attributes.
 
-The elements are of the form (KEY TYPE SET GET) where KEY is a symbol
-identifying the attribute, TYPE is a widget type for editing the
-attibute, SET is a function for setting the attribute value, and GET is a function for getiing the attribute value. 
+The elements are lists of the form (KEY TYPE SET GET) where:
+ KEY is a symbol identifying the attribute.
+ TYPE is a widget type for editing the attribute.
+ SET is a function for setting the attribute value.
+ GET is a function for getting the attribute value.
 
-The SET function should take three arguments, the face to modify, the
+The SET function should take three arguments: the face to modify, the
 value of the attribute, and optionally the frame where the face should
 be changed.
 
 The GET function should take two arguments, the face to examine, and
-optonally the frame where the face should be examined.")
+optionally the frame where the face should be examined.")
 
 (defun face-custom-attributes-set (face frame tags &rest atts)
   "For FACE on FRAME set the attributes [KEYWORD VALUE]....
@@ -192,18 +195,25 @@ If FRAME is nil, use the default face."
 
 (defun custom-face-background-pixmap (face &rest args)
   "Return the name of the background pixmap file used for FACE."
-  (let ((image  (apply 'specifier-instance 
+  (let ((image  (apply 'specifier-instance
                       (face-background-pixmap face) args)))
-    (and image 
+    (and image
         (image-instance-file-name image))))
 
+;; This consistently fails to dtrt
+;;(defun custom-set-face-font-size (face size &optional locale tags)
+;;  "Set the font of FACE to SIZE."
+;;  ;; #### should this call have tags in it?
+;;  (let* ((font (apply 'face-font-name face (list locale)))
+;;      ;; Gag
+;;      (fontobj (font-create-object font)))
+;;    (set-font-size fontobj size)
+;;    (apply 'font-set-face-font face fontobj locale tags)))
+
+;; From Jan Vroonhof -- see faces.el
 (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))
-        ;; Gag
-        (fontobj (font-create-object font)))
-    (set-font-size fontobj size)
-    (apply 'font-set-face-font face fontobj locale tags)))
+  "Set the font of FACE to SIZE."
+  (make-face-size face size locale tags))
 
 (defun custom-face-font-size (face &rest args)
   "Return the size of the font of FACE as a string."
@@ -212,13 +222,20 @@ If FRAME is nil, use the default face."
         (fontobj (font-create-object font)))
     (format "%s" (font-size fontobj))))
 
+;; Jan suggests this may not dtrt
+;;(defun custom-set-face-font-family (face family &optional locale tags)
+;;  "Set the font of FACE to FAMILY."
+;;  ;; #### should this call have tags in it?
+;;  (let* ((font (apply 'face-font-name face (list locale)))
+;;      ;; Gag
+;;      (fontobj (font-create-object font)))
+;;    (set-font-family fontobj family)
+;;    (apply 'font-set-face-font face fontobj locale tags)))
+
+;; From Jan Vroonhof -- see faces.el
 (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))
-        ;; Gag
-        (fontobj (font-create-object font)))
-    (set-font-family fontobj family)
-    (apply 'font-set-face-font face fontobj locale tags)))
+  (make-face-family face family locale tags))
 
 (defun custom-face-font-family (face &rest args)
   "Return the name of the font family of FACE."
@@ -230,7 +247,7 @@ If FRAME is nil, use the default face."
 ;;;###autoload
 (defun custom-set-face-update-spec (face display plist)
   "Customize the FACE for display types matching DISPLAY, merging
-  in the new items from PLIST"
+  in the new items from PLIST."
   (let ((spec (face-spec-update-all-matching (custom-face-get-spec face)
                                             display plist)))
     (put face 'customized-face spec)
@@ -309,7 +326,7 @@ FACE.  Nil otherwise."
 (defun custom-theme-reset-faces (theme &rest args)
   (custom-check-theme theme)
   "Reset the value of the face to values previously defined.
-Assosiate this setting with THEME.
+Associate this setting with THEME.
 
 ARGS is a list of lists of the form
 
@@ -324,9 +341,9 @@ This means reset face to its value in to-theme."
 ;;;###autoload
 (defun custom-reset-faces (&rest args)
   "Reset the value of the face to values previously defined.
-Assosiate this setting with the 'user' theme.
+Associate this setting with the 'user' theme.
 
-ARGS is defined as for `custom-theme-reset-faces'"
+ARGS is defined as for `custom-theme-reset-faces'."
   (apply #'custom-theme-reset-faces 'user args))