[Bug: 21.5-b28] w3 fails on font-spatial-to-canonical

Aidan Kehoe kehoea at parhasard.net
Fri Aug 3 09:40:38 EDT 2007


 Ar an triochadú lá de mí Iúil, scríobh Mike FABIAN: 

 > Giacomo Boffi <giacomo.boffi at polimi.it> さんは書きました:
 > 
 > > w3 (w3-find-file) fails on a call of font-spatial-to-canonical, the
 > > lisp stack follows
 > >
 > > please note that this happens only when xemacs runs in X, w3 on a
 > > tty is ok, afaict
 > 
 > I have already reported the same:
 > 
 > http://thread.gmane.org/gmane.emacs.xemacs.beta/25191
 > 
 > > Debugger entered--Lisp error: (wrong-type-argument numberp nil)
 > >   +(nil 12)
 > >   font-spatial-to-canonical("+12pt")
 > >   css-expand-length("+12pt" t)
 > >   css-expand-value(height "+12pt")
 > >   css-parse-args(238 257)
 > 
 > [...]
 > 
 > It happens only with the Xft build, i.e. if you omit '--with-xft'
 > there is no such problem.

If you have the opportunity, please try the below patch, and tell me if the
problem goes away.

Stephen, does it really bring value to also accept XLFDs on the XFT build? I
get the feeling that using different X resources and separate face and font
handling function for the two builds would be cleaner and more usable. 

lisp/ChangeLog addition:

2007-08-03  Aidan Kehoe  <kehoea at parhasard.net>

	* font.el (x-font-create-object):
	When handed an XFT font name string, parse it as such. 
	* font.el (font-xft-font-regexp):
	Don't check for the existence of xft-font-regexp; accept escaped
	dashes and colons in font family names. 	


XEmacs Trunk source patch:
Diff command:   cvs -q diff -u
Files affected: lisp/font.el
===================================================================
RCS

Index: lisp/font.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/font.el,v
retrieving revision 1.20
diff -u -r1.20 font.el
--- lisp/font.el	2006/04/25 14:01:53	1.20
+++ lisp/font.el	2007/08/03 13:31:05
@@ -587,7 +587,13 @@
   (let ((case-fold-search t))
     (if (or (not (stringp fontname))
 	    (not (string-match font-x-font-regexp fontname)))
-	(make-font)
+	(if (and (stringp fontname)
+		 (string-match font-xft-font-regexp fontname))
+	    ;; Return an XFT font. 
+	    (xft-font-create-object fontname)
+	  ;; It's unclear how to parse the font; return an unspecified
+	  ;; one.
+	  (make-font))
       (let ((family nil)
 	    (size nil)
 	    (weight  (match-string 1 fontname))
@@ -751,16 +757,15 @@
 ;;; #### FIXME actually, this section should be fc-*, right?
 
 (defvar font-xft-font-regexp
-  ;; #### FIXME what the fuck?!?
-  (when (and (boundp 'xft-font-regexp) xft-font-regexp)
-    (concat "\\`"
-	    "[^:-]*"				; optional foundry and family
-						; incorrect, escaping exists
-	    "\\(-[0-9]*\\(\\.[0-9]*\\)?\\)?"	; optional size (points)
-	    "\\(:[^:]*\\)*"			; optional properties
+  (concat "\\`"
+	  #r"\(\\-\|\\:\|[^:-]\)*"	        ; optional foundry and family
+						; (allows for escaped colons, 
+						; dashes.)
+	  "\\(-[0-9]*\\(\\.[0-9]*\\)?\\)?"	; optional size (points)
+	  "\\(:[^:]*\\)*"			; optional properties
 						; not necessarily key=value!!
 	    "\\'"
-	    )))
+	    ))
 
 (defvar font-xft-family-mappings
   ;; #### FIXME this shouldn't be needed or used for Xft

-- 
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)



More information about the XEmacs-Beta mailing list