comparison lisp/faces.el @ 13704:3dcaddea344a

Wrap case-fold-search for x-frob-font-weight and x-frob-font-slant.
author Simon Marshall <simon@gnu.org>
date Tue, 12 Dec 1995 08:20:37 +0000
parents eb141cf52779
children 9729af46fe60
comparison
equal deleted inserted replaced
13703:a185c48f6b61 13704:3dcaddea344a
627 (error "No fonts match `%s'" pattern))) 627 (error "No fonts match `%s'" pattern)))
628 (car fonts)) 628 (car fonts))
629 (cdr (assq 'font (frame-parameters (selected-frame)))))) 629 (cdr (assq 'font (frame-parameters (selected-frame))))))
630 630
631 (defun x-frob-font-weight (font which) 631 (defun x-frob-font-weight (font which)
632 (cond ((string-match x-font-regexp font) 632 (let ((case-fold-search t))
633 (concat (substring font 0 (match-beginning x-font-regexp-weight-subnum)) 633 (cond ((string-match x-font-regexp font)
634 which 634 (concat (substring font 0
635 (substring font (match-end x-font-regexp-weight-subnum) 635 (match-beginning x-font-regexp-weight-subnum))
636 (match-beginning x-font-regexp-adstyle-subnum)) 636 which
637 ;; Replace the ADD_STYLE_NAME field with * 637 (substring font (match-end x-font-regexp-weight-subnum)
638 ;; because the info in it may not be the same 638 (match-beginning x-font-regexp-adstyle-subnum))
639 ;; for related fonts. 639 ;; Replace the ADD_STYLE_NAME field with *
640 "*" 640 ;; because the info in it may not be the same
641 (substring font (match-end x-font-regexp-adstyle-subnum)))) 641 ;; for related fonts.
642 ((or (string-match x-font-regexp-head font) 642 "*"
643 (string-match x-font-regexp-weight font)) 643 (substring font (match-end x-font-regexp-adstyle-subnum))))
644 (concat (substring font 0 (match-beginning 1)) which 644 ((or (string-match x-font-regexp-head font)
645 (substring font (match-end 1)))))) 645 (string-match x-font-regexp-weight font))
646 (concat (substring font 0 (match-beginning 1)) which
647 (substring font (match-end 1)))))))
646 648
647 (defun x-frob-font-slant (font which) 649 (defun x-frob-font-slant (font which)
648 (cond ((string-match x-font-regexp font) 650 (let ((case-fold-search t))
649 (concat (substring font 0 (match-beginning x-font-regexp-slant-subnum)) 651 (cond ((string-match x-font-regexp font)
650 which 652 (concat (substring font 0
651 (substring font (match-end x-font-regexp-slant-subnum) 653 (match-beginning x-font-regexp-slant-subnum))
652 (match-beginning x-font-regexp-adstyle-subnum)) 654 which
653 ;; Replace the ADD_STYLE_NAME field with * 655 (substring font (match-end x-font-regexp-slant-subnum)
654 ;; because the info in it may not be the same 656 (match-beginning x-font-regexp-adstyle-subnum))
655 ;; for related fonts. 657 ;; Replace the ADD_STYLE_NAME field with *
656 "*" 658 ;; because the info in it may not be the same
657 (substring font (match-end x-font-regexp-adstyle-subnum)))) 659 ;; for related fonts.
658 ((or (string-match x-font-regexp-head font) 660 "*"
659 (string-match x-font-regexp-slant font)) 661 (substring font (match-end x-font-regexp-adstyle-subnum))))
660 (concat (substring font 0 (match-beginning 1)) which 662 ((or (string-match x-font-regexp-head font)
661 (substring font (match-end 1)))))) 663 (string-match x-font-regexp-slant font))
664 (concat (substring font 0 (match-beginning 1)) which
665 (substring font (match-end 1)))))))
662 666
663 (defun x-make-font-bold (font) 667 (defun x-make-font-bold (font)
664 "Given an X font specification, make a bold version of it. 668 "Given an X font specification, make a bold version of it.
665 If that can't be done, return nil." 669 If that can't be done, return nil."
666 (x-frob-font-weight font "bold")) 670 (x-frob-font-weight font "bold"))