comparison lisp/international/fontset.el @ 22510:3c054c9dea07

(x-style-funcs-alist): Fix the elements that call two x-... functions so they don't call the second if the first gives nil. (fontset-default-styles): New variable. (create-fontset-from-fontset-spec): Use fontset-default-styles.
author Karl Heuer <kwzh@gnu.org>
date Fri, 19 Jun 1998 16:54:41 +0000
parents c87830c691a5
children 3b18bf846d3c
comparison
equal deleted inserted replaced
22509:a57016ec7f14 22510:3c054c9dea07
415 (bold-oblique 415 (bold-oblique
416 . ,(function (lambda (x) (x-make-font-oblique (x-make-font-bold x)))))) 416 . ,(function (lambda (x) (x-make-font-oblique (x-make-font-bold x))))))
417 "Alist of font style vs function to generate a X font name of the style. 417 "Alist of font style vs function to generate a X font name of the style.
418 The function is called with one argument, a font name.") 418 The function is called with one argument, a font name.")
419 419
420 (defconst x-style-funcs-alist
421 `((bold . x-make-font-bold)
422 (demibold . x-make-font-demibold)
423 (italic . x-make-font-italic)
424 (oblique . x-make-font-oblique)
425 (bold-italic . x-make-font-bold-italic)
426 (demibold-italic
427 . ,(function (lambda (x)
428 (let ((y (x-make-font-demibold x)))
429 (and y (x-make-font-italic y))))))
430 (demibold-oblique
431 . ,(function (lambda (x)
432 (let ((y (x-make-font-demibold x)))
433 (and y (x-make-font-oblique y))))))
434 (bold-oblique
435 . ,(function (lambda (x)
436 (let ((y (x-make-font-bold x)))
437 (and y (x-make-font-oblique y)))))))
438 "Alist of font style vs function to generate a X font name of the style.
439 The function is called with one argument, a font name.")
440
441 (defcustom fontset-default-styles '(bold italic bold-italic)
442 "List of alternative styles to create for a fontset.
443 Valid elements include `bold', `demibold'; `italic', `oblique';
444 and combinations of one from each group,
445 such as `bold-italic' and `demibold-oblique'."
446 :group 'faces
447 :type '(set bold demibold italic oblique bold-italic bold-oblique
448 demibold-italic demibold-oblique))
449
420 (defun x-modify-font-name (fontname style) 450 (defun x-modify-font-name (fontname style)
421 "Substitute style specification part of FONTNAME for STYLE. 451 "Substitute style specification part of FONTNAME for STYLE.
422 STYLE should be listed in the variable `x-style-funcs-alist'." 452 STYLE should be listed in the variable `x-style-funcs-alist'."
423 (let ((func (cdr (assq style x-style-funcs-alist)))) 453 (let ((func (cdr (assq style x-style-funcs-alist))))
424 (if func 454 (if func
486 (cons (cons name ascii-font) 516 (cons (cons name ascii-font)
487 fontset-alias-alist)))) 517 fontset-alias-alist))))
488 518
489 ;; At last, handle style variants. 519 ;; At last, handle style variants.
490 (if (eq style-variant t) 520 (if (eq style-variant t)
491 (setq style-variant (mapcar 'car x-style-funcs-alist))) 521 (setq style-variant fontset-default-styles))
492 522
493 (if style-variant 523 (if style-variant
494 ;; Generate fontset names of style variants and set them 524 ;; Generate fontset names of style variants and set them
495 ;; in uninstantiated-fontset-alist. 525 ;; in uninstantiated-fontset-alist.
496 (let* (nonascii-fontlist 526 (let* (nonascii-fontlist