aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa1997-03-18 23:16:27 +0000
committerKenichi Handa1997-03-18 23:16:27 +0000
commit441038a65fb160026368408c0deefaf0777993fb (patch)
treeef1dfcf66bbcab056d891129c1bb91009af57e33
parentd2382a1dd304988650f04927a876b12099eec61d (diff)
downloademacs-441038a65fb160026368408c0deefaf0777993fb.tar.gz
emacs-441038a65fb160026368408c0deefaf0777993fb.zip
(x-charset-registries): Change entry for Ethiopic.
Typo in comments fixed. (fontset-plain-name): Set correct size information. (x-reduce-font-name): New function. (x-compose-font-name): New optional argument REDUCE. (x-complement-fontset-spec): Call x-compose-font-name with t for the above argument.
-rw-r--r--lisp/international/fontset.el27
1 files changed, 20 insertions, 7 deletions
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index cc5309decdc..9c8c2766e8f 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -68,7 +68,7 @@
68 (arabic-1-column . "MuleArabic-1") 68 (arabic-1-column . "MuleArabic-1")
69 (arabic-2-column . "MuleArabic-2") 69 (arabic-2-column . "MuleArabic-2")
70 (ipa . "MuleIPA") 70 (ipa . "MuleIPA")
71 (ethiopic . "Ethio") 71 (ethiopic . "Ethiopic-Unicode")
72 (ascii-right-to-left . "ISO8859-1") 72 (ascii-right-to-left . "ISO8859-1")
73 (indian-is13194 . "IS13194-Devanagari") 73 (indian-is13194 . "IS13194-Devanagari")
74 (indian-2-column . "MuleIndian-2") 74 (indian-2-column . "MuleIndian-2")
@@ -195,11 +195,24 @@ PATTERN. If no full XLFD name is gotten, return nil."
195 (setq l (cdr (cdr l)))))) 195 (setq l (cdr (cdr l))))))
196 xlfd-fields))))) 196 xlfd-fields)))))
197 197
198(defsubst x-compose-font-name (xlfd-fields) 198;; Replace consecutive wild-cards (`*') in NAME to one.
199;; Ex. (x-reduce-font-name "-*-*-*-iso8859-1") => "-*-iso8859-1"
200(defsubst x-reduce-font-name (name)
201 (while (string-match "-\\*-\\(\\*-\\)+" name)
202 (setq name (replace-match "-*-" t t name)))
203 name)
204
205(defun x-compose-font-name (xlfd-fields &optional reduce)
199 "Compose X's fontname from FIELDS. 206 "Compose X's fontname from FIELDS.
200FIELDS is a vector of XLFD fields. 207FIELDS is a vector of XLFD fields.
201If a field is nil, wild-card character `*' is embedded." 208If a field is nil, wild-card letter `*' is embedded.
202 (concat "-" (mapconcat (lambda (x) (or x "*")) xlfd-fields "-"))) 209Optional argument REDUCE non-nil means consecutive wild-cards are
210reduced to be one."
211 (let ((name
212 (concat "-" (mapconcat (lambda (x) (or x "*")) xlfd-fields "-"))))
213 (if reduce
214 (x-reduce-font-name name)
215 name)))
203 216
204(defun x-complement-fontset-spec (xlfd-fields fontlist) 217(defun x-complement-fontset-spec (xlfd-fields fontlist)
205 "Complement FONTLIST for all charsets based on XLFD-FIELDS and return it. 218 "Complement FONTLIST for all charsets based on XLFD-FIELDS and return it.
@@ -226,7 +239,7 @@ automatically."
226 (concat registry "*")) 239 (concat registry "*"))
227 (aset xlfd-fields xlfd-regexp-encoding-subnum "*")) 240 (aset xlfd-fields xlfd-regexp-encoding-subnum "*"))
228 (setq fontlist 241 (setq fontlist
229 (cons (cons charset (x-compose-font-name xlfd-fields)) 242 (cons (cons charset (x-compose-font-name xlfd-fields t))
230 fontlist))))) 243 fontlist)))))
231 (setq charsets (cdr charsets)))) 244 (setq charsets (cdr charsets))))
232 fontlist) 245 fontlist)
@@ -255,8 +268,8 @@ automatically."
255 (swidth (aref xlfd-fields xlfd-regexp-swidth-subnum)) 268 (swidth (aref xlfd-fields xlfd-regexp-swidth-subnum))
256 (size (aref xlfd-fields xlfd-regexp-pixelsize-subnum)) 269 (size (aref xlfd-fields xlfd-regexp-pixelsize-subnum))
257 name) 270 name)
258 (if (integerp size) 271 (if (> (string-to-int size) 0)
259 (setq name (format "%d " size)) 272 (setq name (format "%s " size))
260 (setq name "")) 273 (setq name ""))
261 (if (string-match "bold\\|demibold" weight) 274 (if (string-match "bold\\|demibold" weight)
262 (setq name (concat name weight " "))) 275 (setq name (concat name weight " ")))