comparison lisp/msw-faces.el @ 321:19dcec799385 r21-0-58

Import from CVS: tag r21-0-58
author cvs
date Mon, 13 Aug 2007 10:46:44 +0200
parents afd57c14dfc8
children cc15677e0335
comparison
equal deleted inserted replaced
320:73c75c43c1f2 321:19dcec799385
143 newfont)))))) 143 newfont))))))
144 144
145 (defun mswindows-find-smaller-font (font &optional device) 145 (defun mswindows-find-smaller-font (font &optional device)
146 "Loads a new version of the given font (or font name) 1 point smaller. 146 "Loads a new version of the given font (or font name) 1 point smaller.
147 Returns the font if it succeeds, nil otherwise." 147 Returns the font if it succeeds, nil otherwise."
148 (if (stringp font) (setq font (make-font-instance font device)))
149 (if (font-instance-p font) (setq font (font-instance-truename font)))
150 (if (stringp font) (setq font (make-font-instance font device)))
148 (if (font-instance-p font) 151 (if (font-instance-p font)
149 (let (old-size (name (mswindows-font-canonicalize-name font))) 152 (let (old-size (name (mswindows-font-canonicalize-name font)))
150 (string-match "^[a-zA-Z ]+:[a-zA-Z ]*:\\([0-9]+\\):" name) 153 (string-match "^[a-zA-Z ]+:[a-zA-Z ]*:\\([0-9]+\\):" name)
151 (setq old-size (string-to-int 154 (setq old-size (string-to-int
152 (substring name (match-beginning 1) (match-end 1)))) 155 (substring name (match-beginning 1) (match-end 1))))
158 device t))))) 161 device t)))))
159 162
160 (defun mswindows-find-larger-font (font &optional device) 163 (defun mswindows-find-larger-font (font &optional device)
161 "Loads a new version of the given font (or font name) 1 point larger. 164 "Loads a new version of the given font (or font name) 1 point larger.
162 Returns the font if it succeeds, nil otherwise." 165 Returns the font if it succeeds, nil otherwise."
166 (if (stringp font) (setq font (make-font-instance font device)))
167 (if (font-instance-p font) (setq font (font-instance-truename font)))
168 (if (stringp font) (setq font (make-font-instance font device)))
163 (if (font-instance-p font) 169 (if (font-instance-p font)
164 (let (old-size (name (mswindows-font-canonicalize-name font))) 170 (let (old-size (name (mswindows-font-canonicalize-name font)))
165 (string-match "^[a-zA-Z ]+:[a-zA-Z ]*:\\([0-9]+\\):" name) 171 (string-match "^[a-zA-Z ]+:[a-zA-Z ]*:\\([0-9]+\\):" name)
166 (setq old-size (string-to-int 172 (setq old-size (string-to-int
167 (substring name (match-beginning 1) (match-end 1)))) 173 (substring name (match-beginning 1) (match-end 1))))