bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: B&W display and emacs21


From: Gerd Moellmann
Subject: Re: B&W display and emacs21
Date: 24 Oct 2001 13:08:59 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.50

Adam <adam@cfar.umd.edu> writes:

> although it seems to be just for this B&W display (styx:0.0) (xterminal)

Okay, I think I have it.  Could you please try

*** fontset.el  2001/10/24 10:27:04     1.48
--- fontset.el  2001/10/24 11:06:08
***************
*** 2,7 ****
--- 2,8 ----
  
  ;; Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
  ;; Licensed to the Free Software Foundation.
+ ;; Copyright (C) 2001 Free Software Foundation, Inc.
  
  ;; Keywords: mule, multilingual, fontset
  
***************
*** 303,308 ****
--- 304,330 ----
  backward compatibility."
    (concat "-" (mapconcat (lambda (x) (or x "*")) fields "-")))
  
+ 
+ (defun x-must-resolve-font-name (xlfd-fields)
+   "Like `x-resolve-font-name', but always return a font name.
+ XLFD-FIELDS is a vector of XLFD (X Logical Font Description) fields.
+ If no font matching XLFD-FIELDS is available, successively replace
+ parts of the font name pattern with \"*\" until some font is found.
+ Value is name of that font."
+   (let ((ascii-font nil) (index 0))
+     (while (and (null ascii-font) (<= index xlfd-regexp-encoding-subnum))
+       (let ((pattern (x-compose-font-name xlfd-fields)))
+       (condition-case nil
+           (setq ascii-font (x-resolve-font-name pattern))
+         (error
+          (message "Warning: no fonts matching `%s' available" pattern)
+          (aset xlfd-fields index "*")
+          (setq index (1+ index))))))
+     (unless ascii-font
+       (error "No fonts founds"))
+     ascii-font))
+ 
+ 
  (defun x-complement-fontset-spec (xlfd-fields fontlist)
    "Complement FONTLIST for charsets based on XLFD-FIELDS and return it.
  XLFD-FIELDS is a vector of XLFD (X Logical Font Description) fields.
***************
*** 324,330 ****
        ;; If font for ASCII is not specified, add it.
        (aset xlfd-fields xlfd-regexp-registry-subnum "iso8859")
        (aset xlfd-fields xlfd-regexp-encoding-subnum "1")
!       (setq ascii-font (x-resolve-font-name (x-compose-font-name 
xlfd-fields)))
        (setq fontlist (cons (cons 'ascii ascii-font) fontlist)))
  
      ;; If the font for ASCII also supports the other charsets, and
--- 346,352 ----
        ;; If font for ASCII is not specified, add it.
        (aset xlfd-fields xlfd-regexp-registry-subnum "iso8859")
        (aset xlfd-fields xlfd-regexp-encoding-subnum "1")
!       (setq ascii-font (x-must-resolve-font-name xlfd-fields))
        (setq fontlist (cons (cons 'ascii ascii-font) fontlist)))
  
      ;; If the font for ASCII also supports the other charsets, and



reply via email to

[Prev in Thread] Current Thread [Next in Thread]