emacs-diffs
[Top][All Lists]
Advanced

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

master 7d9513f9c48: Improve face font selection on MS-Windows


From: Eli Zaretskii
Subject: master 7d9513f9c48: Improve face font selection on MS-Windows
Date: Sat, 12 Oct 2024 13:56:42 -0400 (EDT)

branch: master
commit 7d9513f9c48ba4d197502ad8196d51f18894145e
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Improve face font selection on MS-Windows
    
    * lisp/net/dictionary.el (dictionary-word-definition-face):
    Special-case w32.
    * lisp/faces.el (face-font-family-alternatives): Add a few modern
    font families.
---
 lisp/faces.el          | 7 +++++--
 lisp/net/dictionary.el | 8 ++++++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/lisp/faces.el b/lisp/faces.el
index c3a54a08a3d..21c3e663c6e 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -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 ...).
diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 3d3dd6d28fa..50e23727c61 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -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))



reply via email to

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