diff options
| author | Karl Heuer | 1998-06-19 16:54:41 +0000 |
|---|---|---|
| committer | Karl Heuer | 1998-06-19 16:54:41 +0000 |
| commit | d96917194a122a7fee4f72f023c7d5df9ae359aa (patch) | |
| tree | 3c03cdadacf62a509d2e33fdd16aa7f5b7da660a | |
| parent | 33d0a17f04da437a13e10fc64105eb6a70967e03 (diff) | |
| download | emacs-d96917194a122a7fee4f72f023c7d5df9ae359aa.tar.gz emacs-d96917194a122a7fee4f72f023c7d5df9ae359aa.zip | |
(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.
| -rw-r--r-- | lisp/international/fontset.el | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 3944e481d94..365bc3f3921 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el | |||
| @@ -417,6 +417,36 @@ FONTLIST is an alist of charsets vs font names to be used in FONSET.") | |||
| 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'." |
| @@ -488,7 +518,7 @@ signaled unless the optional 3rd argument NOERROR is non-nil." | |||
| 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 |