]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve face font selection on MS-Windows
authorEli Zaretskii <eliz@gnu.org>
Sat, 12 Oct 2024 17:55:47 +0000 (20:55 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 14 Oct 2024 17:39:55 +0000 (19:39 +0200)
* lisp/net/dictionary.el (dictionary-word-definition-face):
Special-case w32.
* lisp/faces.el (face-font-family-alternatives): Add a few modern
font families.

(cherry picked from commit 7d9513f9c48ba4d197502ad8196d51f18894145e)

lisp/faces.el
lisp/net/dictionary.el

index 27f5a705190498a2f0efa5dbacb309ed62204ea8..75dfa50ac0c24e7cfbb52495a40e65039a423a39 100644 (file)
@@ -100,7 +100,7 @@ a font height that isn't optimal."
 ;; which are generally available.
 (defcustom face-font-family-alternatives
   (mapcar (lambda (arg) (mapcar 'purecopy arg))
-  '(("Monospace" "courier" "fixed")
+  '(("Monospace" "Cascadia Code" "Lucida Console" "courier" "fixed")
 
     ;; Monospace Serif is an Emacs invention, intended to work around
     ;; portability problems when using Courier.  It should work well
@@ -133,7 +133,10 @@ a font height that isn't optimal."
     ;; This is present for backward compatibility.
     ("courier" "CMU Typewriter Text" "fixed")
 
-    ("Sans Serif" "helv" "helvetica" "arial" "fixed")
+    ("Sans Serif"
+     ;; https://en.wikipedia.org/wiki/List_of_typefaces_included_with_Microsoft_Windows
+     "Calibri" "Tahoma" "Lucida Sans Unicode"
+     "helv" "helvetica" "arial" "fixed")
     ("helv" "helvetica" "arial" "fixed")))
   "Alist of alternative font family names.
 Each element has the form (FAMILY ALTERNATIVE1 ALTERNATIVE2 ...).
index 2b41ef5569757feed2f68d1ee4e097d59aa83feb..6b26456cb44227f94eeba4ae29f73d22acce7237 100644 (file)
@@ -320,7 +320,11 @@ Otherwise, `dictionary-search' displays definitions in a *Dictionary* buffer."
   :version "30.1")
 
 (defface dictionary-word-definition-face
-  '((((supports (:family "DejaVu Serif")))
+  ;; w32 first, because 'supports' doesn't really tell whether the font
+  ;; family exists, and MS-Windows selects an ugly font as result.
+  '((((type w32))
+     (:font "Sans Serif"))
+    (((supports (:family "DejaVu Serif")))
      (:family "DejaVu Serif"))
     (((type x))
      (:font "Sans Serif"))
@@ -328,7 +332,7 @@ Otherwise, `dictionary-search' displays definitions in a *Dictionary* buffer."
      (:font "default")))
 "The face that is used for displaying the definition of the word."
 :group 'dictionary
-:version "28.1")
+:version "31.1")
 
 (defface dictionary-word-entry-face
   '((((type x))