# HG changeset patch # User aidan # Date 1186383627 0 # Node ID a5e2d0f90f97b9a272c7dcbf6d503c2ae02eb6c5 # Parent 7f58c7282a52c05655a329fe1cacae74f58e0c8a [xemacs-hg @ 2007-08-06 07:00:26 by aidan] Handle XFT fonts in x-font-create-object. diff -r 7f58c7282a52 -r a5e2d0f90f97 lisp/ChangeLog --- a/lisp/ChangeLog Sun Aug 05 21:51:15 2007 +0000 +++ b/lisp/ChangeLog Mon Aug 06 07:00:27 2007 +0000 @@ -1,3 +1,11 @@ +2007-08-06 Aidan Kehoe <kehoea@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, colons and commas in font family names. + 2007-08-04 Aidan Kehoe <kehoea@parhasard.net> * unicode.el: diff -r 7f58c7282a52 -r a5e2d0f90f97 lisp/font.el --- a/lisp/font.el Sun Aug 05 21:51:15 2007 +0000 +++ b/lisp/font.el Mon Aug 06 07:00:27 2007 +0000 @@ -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, commas) + "\\(-[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