comparison lisp/x-faces.el @ 444:576fb035e263 r21-2-37

Import from CVS: tag r21-2-37
author cvs
date Mon, 13 Aug 2007 11:36:19 +0200
parents abe6d1db359e
children 7039e6323819
comparison
equal deleted inserted replaced
443:a8296e22da4e 444:576fb035e263
99 (registry "[^-]*") ; some fonts have omitted registries 99 (registry "[^-]*") ; some fonts have omitted registries
100 ; (encoding ".+") ; note that encoding may contain "-"... 100 ; (encoding ".+") ; note that encoding may contain "-"...
101 (encoding "[^-]+") ; false! 101 (encoding "[^-]+") ; false!
102 ) 102 )
103 (setq x-font-regexp 103 (setq x-font-regexp
104 (purecopy 104 (concat "\\`\\*?[-?*]"
105 (concat "\\`\\*?[-?*]" 105 foundry - family - weight\? - slant\? - swidth - adstyle -
106 foundry - family - weight\? - slant\? - swidth - adstyle - 106 pixelsize - pointsize - resx - resy - spacing - avgwidth -
107 pixelsize - pointsize - resx - resy - spacing - avgwidth - 107 registry - encoding "\\'"
108 registry - encoding "\\'" 108 ))
109 )))
110 (setq x-font-regexp-head 109 (setq x-font-regexp-head
111 (purecopy 110 (concat "\\`[-?*]" foundry - family - weight\? - slant\?
112 (concat "\\`[-?*]" foundry - family - weight\? - slant\? 111 "\\([-*?]\\|\\'\\)"))
113 "\\([-*?]\\|\\'\\)")))
114 (setq x-font-regexp-head-2 112 (setq x-font-regexp-head-2
115 (purecopy 113 (concat "\\`[-?*]" foundry - family - weight\? - slant\?
116 (concat "\\`[-?*]" foundry - family - weight\? - slant\? 114 - swidth - adstyle - pixelsize - pointsize
117 - swidth - adstyle - pixelsize - pointsize 115 "\\([-*?]\\|\\'\\)"))
118 "\\([-*?]\\|\\'\\)"))) 116 (setq x-font-regexp-slant (concat - slant -))
119 (setq x-font-regexp-slant (purecopy (concat - slant -))) 117 (setq x-font-regexp-weight (concat - weight -))
120 (setq x-font-regexp-weight (purecopy (concat - weight -)))
121 ;; if we can't match any of the more specific regexps (unfortunate) then 118 ;; if we can't match any of the more specific regexps (unfortunate) then
122 ;; look for digits; assume 2+ digits is 10ths of points, and 1-2 digits 119 ;; look for digits; assume 2+ digits is 10ths of points, and 1-2 digits
123 ;; is pixels. Bogus as hell. 120 ;; is pixels. Bogus as hell.
124 (setq x-font-regexp-pixel (purecopy "[-?*]\\([0-9][0-9]?\\)[-?*]")) 121 (setq x-font-regexp-pixel "[-?*]\\([0-9][0-9]?\\)[-?*]")
125 (setq x-font-regexp-point (purecopy "[-?*]\\([0-9][0-9]+\\)[-?*]")) 122 (setq x-font-regexp-point "[-?*]\\([0-9][0-9]+\\)[-?*]")
126 ;; the following two are used by x-font-menu.el. 123 ;; the following two are used by x-font-menu.el.
127 (setq x-font-regexp-foundry-and-family 124 (setq x-font-regexp-foundry-and-family
128 (purecopy (concat "\\`[-?*]" foundry - "\\(" family "\\)" -))) 125 (concat "\\`[-?*]" foundry - "\\(" family "\\)" -))
129 (setq x-font-regexp-registry-and-encoding 126 (setq x-font-regexp-registry-and-encoding
130 (purecopy (concat - "\\(" registry "\\)" - "\\(" encoding "\\)\\'"))) 127 (concat - "\\(" registry "\\)" - "\\(" encoding "\\)\\'"))
131 (setq x-font-regexp-spacing 128 (setq x-font-regexp-spacing
132 (purecopy (concat - "\\(" spacing "\\)" - avgwidth 129 (concat - "\\(" spacing "\\)" - avgwidth
133 - registry - encoding "\\'"))) 130 - registry - encoding "\\'"))
134 ) 131 )
135 132
136 ;; A "loser font" is something like "8x13" -> "8x13bold". 133 ;; A "loser font" is something like "8x13" -> "8x13bold".
137 ;; These are supported only through extreme generosity. 134 ;; These are supported only through extreme generosity.
138 (defconst x-loser-font-regexp (purecopy "\\`[0-9]+x[0-9]+\\'")) 135 (defconst x-loser-font-regexp "\\`[0-9]+x[0-9]+\\'")
139 136
140 (defun x-frob-font-weight (font which) 137 (defun x-frob-font-weight (font which)
141 (if (font-instance-p font) (setq font (font-instance-name font))) 138 (if (font-instance-p font) (setq font (font-instance-name font)))
142 (cond ((null font) nil) 139 (cond ((null font) nil)
143 ((or (string-match x-font-regexp font) 140 ((or (string-match x-font-regexp font)