Mercurial > hg > xemacs-beta
changeset 4099:a5e2d0f90f97
[xemacs-hg @ 2007-08-06 07:00:26 by aidan]
Handle XFT fonts in x-font-create-object.
author | aidan |
---|---|
date | Mon, 06 Aug 2007 07:00:27 +0000 |
parents | 7f58c7282a52 |
children | d1cf2b9c4dfd |
files | lisp/ChangeLog lisp/font.el |
diffstat | 2 files changed, 22 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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:
--- 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