I've made the attached changes against b44 to almost fix customising
fonts in mswindows. I'm stuck on the font family 'though and could use
some help on whether and how this works under X:
custom-face-attributes in us-face.el contains the following entry for
the font family name:
(:family (editable-field :format "Font Family: %v"
:help-echo "\
Name of font family to use (e.g. times).")
custom-set-face-font-family custom-face-font-family)
custom-face-font-family returns a list because font-family returns a
list. When the above entry is processed the "%v" in the format string
appears to cause widget-field-match to be called on the family name
returned by custom-face-font-family, but widget-field-match expects a
string not a list.
How can this work under X ?
Jonathan.
--
Jonathan Harris | jhar(a)tardis.ed.ac.uk
London, England | Jonathan-Harris(a)psion.com
--- xemacs-20/lisp/font.el Mon May 18 11:48:56 1998
+++ xemacs-21.0/lisp/font.el Tue Jun 16 23:32:03 1998
@@ -798,7 +798,7 @@
(:demi . "Demi")
(:book . "Book")
(:medium . "Medium")
- (:normal . "Medium")
+ (:normal . "Normal")
(:demi-bold . "Demibold")
(:bold . "Bold")
(:regular . "Regular")
@@ -813,7 +813,7 @@
(if (or (not (stringp font))
(not (string-match font-mswindows-font-regexp font)))
(make-font)
- (let ((name (match-string 1 font))
+ (let ((family (match-string 1 font))
(weight (match-string 2 font))
(style (match-string 3 font))
(pointsize (match-string 4 font))
@@ -823,15 +823,16 @@
(size nil)
(case-fold-search t)
)
- (if pointsize (setq size (/ (string-to-int pointsize) 10)))
+ (if pointsize (setq size (concat pointsize "pt")))
(if weight (setq weight (intern-soft (concat ":" (downcase weight)))))
- (setq retval (make-font :family name
+ (setq retval (make-font :family family
:weight weight
- :size size))
+ :size size
+ :encoding charset))
(set-font-bold-p retval (eq :bold weight))
(cond
((null style) nil)
- ((string-match "^[iI]talic" style)
+ ((string-match "^ *[iI]talic" style)
(set-font-italic-p retval t)))
retval))))
@@ -847,7 +848,7 @@
(let* ((default (font-default-object-for-device device))
(family (or (font-family fontobj)
(font-family default)))
- (weight (or (font-weight fontobj) :medium))
+ (weight (or (font-weight fontobj) :regular))
(style (font-style fontobj))
(size (or (if font-running-xemacs
(font-size fontobj))
@@ -886,9 +887,9 @@
(if (font-italic-p fontobj)
" Italic" "")
(if size
- (int-to-string (* 10 size)) "10")
+ (int-to-string size) "10")
""
- "")
+ encoding)
done (try-font-name font-name device))))
(if done font-name)))))