Mercurial > hg > xemacs-beta
comparison lisp/msw-faces.el @ 294:4b85ae5eabfb r21-0b45
Import from CVS: tag r21-0b45
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:38:01 +0200 |
parents | c9fe270a4101 |
children | 70ad99077275 |
comparison
equal
deleted
inserted
replaced
293:403535bfea94 | 294:4b85ae5eabfb |
---|---|
47 | 47 |
48 | 48 |
49 ;;; Fill in missing parts of a font spec. This is primarily intended as a | 49 ;;; Fill in missing parts of a font spec. This is primarily intended as a |
50 ;;; helper function for the functions below. | 50 ;;; helper function for the functions below. |
51 ;;; mswindows fonts look like: | 51 ;;; mswindows fonts look like: |
52 ;;; fontname[:[weight][ style][:pointsize[:effects[:charset]]]] | 52 ;;; fontname[:[weight][ style][:pointsize[:effects]]][:charset] |
53 ;;; A minimal mswindows font spec looks like: | 53 ;;; A minimal mswindows font spec looks like: |
54 ;;; Courier New | 54 ;;; Courier New |
55 ;;; A maximal mswindows font spec looks like: | 55 ;;; A maximal mswindows font spec looks like: |
56 ;;; Courier New:Bold Italic:10:underline strikeout:ansi | 56 ;;; Courier New:Bold Italic:10:underline strikeout:western |
57 ;;; Missing parts of the font spec should be filled in with these values: | 57 ;;; Missing parts of the font spec should be filled in with these values: |
58 ;;; Courier New:Normal:10::ansi | 58 ;;; Courier New:Normal:10::western |
59 (defun mswindows-font-canonicalize-name (font) | 59 (defun mswindows-font-canonicalize-name (font) |
60 "Given a mswindows font or font specification, this returns its | 60 "Given a mswindows font or font specification, this returns its |
61 specification in canonical form." | 61 specification in canonical form." |
62 (if (or (font-instance-p font) | 62 (if (or (font-instance-p font) |
63 (stringp font)) | 63 (stringp font)) |
66 font))) | 66 font))) |
67 (cond ((string-match | 67 (cond ((string-match |
68 "^[a-zA-Z ]+:[a-zA-Z ]*:[0-9]+:[a-zA-Z ]*:[a-zA-Z 0-9]*$" | 68 "^[a-zA-Z ]+:[a-zA-Z ]*:[0-9]+:[a-zA-Z ]*:[a-zA-Z 0-9]*$" |
69 name) name) | 69 name) name) |
70 ((string-match "^[a-zA-Z ]+:[a-zA-Z ]*:[0-9]+:[a-zA-Z ]*$" | 70 ((string-match "^[a-zA-Z ]+:[a-zA-Z ]*:[0-9]+:[a-zA-Z ]*$" |
71 name) (concat name ":ansi")) | 71 name) (concat name ":western")) |
72 ((string-match "^[a-zA-Z ]+:[a-zA-Z ]*:[0-9]+$" name) | 72 ((string-match "^[a-zA-Z ]+:[a-zA-Z ]*:[0-9]+$" name) |
73 (concat name "::ansi")) | 73 (concat name "::western")) |
74 ((string-match "^[a-zA-Z ]+:[a-zA-Z ]*$" name) | 74 ((string-match "^[a-zA-Z ]+:[a-zA-Z ]*$" name) |
75 (concat name ":10::ansi")) | 75 (concat name ":10::western")) |
76 ((string-match "^[a-zA-Z ]+$" name) | 76 ((string-match "^[a-zA-Z ]+$" name) |
77 (concat name ":Normal:10::ansi")) | 77 (concat name ":Normal:10::western")) |
78 (t "Courier New:Normal:10::ansi"))))) | 78 (t "Courier New:Normal:10::western"))))) |
79 | 79 |
80 (defun mswindows-make-font-bold (font &optional device) | 80 (defun mswindows-make-font-bold (font &optional device) |
81 "Given a mswindows font specification, this attempts to make a bold font. | 81 "Given a mswindows font specification, this attempts to make a bold font. |
82 If it fails, it returns nil." | 82 If it fails, it returns nil." |
83 (if (font-instance-p font) | 83 (if (font-instance-p font) |