>>>> "Sean" == Sean Dague <sean(a)dague.net>
writes:
Sean> I've tracked down my font issue further, and hope someone
Sean> can help with this. This should be repeatable in any
Sean> environment.
If it were, it would be a FAQ. Something special is happening here,
and it's not obvious what. It may be a bug in planner (which isn't in
the XEmacs packages installed on this box).
Sean> My processing of init.el runs fine, and processing of
Sean> custom.el works *until* it hits (require 'planner), at which
Sean> point there is a bit ugly stack trace involving 'monospace'.
Sean> (It was posted to this list previously)
The patch below should help with this.
Sean> If I load-file .xemacs/custom.el after that, it processes
Sean> fine. Though the header font for emacs-wiki ends up being
Sean> the first monospace font it can find (alphabeticaly), which
Sean> ends up being a really aweful choice.
The patch probably will not help with this.
Sean> Any suggestions on how I can prespecify that font?
Find out what the name of the face is and set-face-font it.
Here's the patch (which is entirely the incorrect approach, but it
should prevent the stack trace).
Index: lisp/font.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/font.el,v
retrieving revision 1.19
diff -u -r1.19 font.el
--- lisp/font.el 5 Dec 2005 09:43:37 -0000 1.19
+++ lisp/font.el 26 Jan 2006 05:11:10 -0000
@@ -796,7 +796,8 @@
"A list of font family mappings on Xft devices.")
(defun xft-font-create-object (fontname &optional device)
- "Return a font descriptor object for FONTNAME, appropriate for Xft."
+ "Return a font descriptor object for FONTNAME, appropriate for Xft.
+FONTNAME must be a string. Optional DEVICE is a device object."
(let* ((name fontname)
(device (or device (default-x-device)))
(pattern (fc-font-real-pattern name device))
Index: lisp/x-faces.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/x-faces.el,v
retrieving revision 1.23
diff -u -r1.23 x-faces.el
--- lisp/x-faces.el 5 Dec 2005 09:43:37 -0000 1.23
+++ lisp/x-faces.el 26 Jan 2006 05:11:11 -0000
@@ -182,8 +182,11 @@
(x-make-font-bold-core font device)))
(defun x-make-font-bold-xft (font &optional device)
- (let ((pattern (fc-font-real-pattern
- font (or device (default-x-device)))))
+ (let* ((font (if (stringp font)
+ font
+ (font-instance-name font)))
+ (pattern (fc-font-real-pattern
+ font (or device (default-x-device)))))
(if pattern
(let ((size (fc-pattern-get-size pattern 0))
(copy (fc-copy-pattern-partial
@@ -230,8 +233,11 @@
(x-make-font-unbold-core font device)))
(defun x-make-font-unbold-xft (font &optional device)
- (let ((pattern (fc-font-real-pattern
- font (or device (default-x-device)))))
+ (let* ((font (if (stringp font)
+ font
+ (font-instance-name font)))
+ (pattern (fc-font-real-pattern
+ font (or device (default-x-device)))))
(when pattern
(fc-pattern-del pattern fc-font-name-property-weight)
(fc-pattern-add pattern fc-font-name-property-weight
@@ -261,8 +267,11 @@
(x-make-font-italic-core font device)))
(defun x-make-font-italic-xft (font &optional device)
- (let ((pattern (fc-font-real-pattern
- font (or device (default-x-device)))))
+ (let* ((font (if (stringp font)
+ font
+ (font-instance-name font)))
+ (pattern (fc-font-real-pattern
+ font (or device (default-x-device)))))
(if pattern
(let ((size (fc-pattern-get-size pattern 0))
(copy (fc-copy-pattern-partial
@@ -317,8 +326,11 @@
(x-make-font-unitalic-core font device)))
(defun x-make-font-unitalic-xft (font &optional device)
- (let ((pattern (fc-font-real-pattern
- font (or device (default-x-device)))))
+ (let* ((font (if (stringp font)
+ font
+ (font-instance-name font)))
+ (pattern (fc-font-real-pattern
+ font (or device (default-x-device)))))
(when pattern
(fc-pattern-del pattern fc-font-name-property-slant)
(fc-pattern-add pattern fc-font-name-property-slant
@@ -385,8 +397,11 @@
;; this is unbelievable &*@#
(defun x-font-size-xft (font)
- (let ((pattern (fc-font-real-pattern
- font (default-x-device))))
+ (let* ((font (if (stringp font)
+ font
+ (font-instance-name font)))
+ (pattern (fc-font-real-pattern
+ font (default-x-device))))
(when pattern
(let ((pixelsize (fc-pattern-get-pixelsize pattern 0)))
(if (floatp pixelsize) (round pixelsize))))))
@@ -517,7 +532,10 @@
(x-find-smaller-font-core font device)))
(defun x-find-xft-font-of-size (font new-size-proc &optional device)
- (let* ((pattern (fc-font-real-pattern
+ (let* ((font (if (stringp font)
+ font
+ (font-instance-name font)))
+ (pattern (fc-font-real-pattern
font (or device (default-x-device)))))
(when pattern
(let ((size (fc-pattern-get-size pattern 0)))
--
School of Systems and Information Engineering
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.