emacs-diffs
[Top][All Lists]
Advanced

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

master b31f198: Support more font weight values on MS-Windows


From: Eli Zaretskii
Subject: master b31f198: Support more font weight values on MS-Windows
Date: Sun, 17 Nov 2019 11:20:07 -0500 (EST)

branch: master
commit b31f1987eb27a69d7c0eab9cce6eab8ba0857ec1
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Support more font weight values on MS-Windows
    
    * src/w32font.c (w32_to_fc_weight): Support a few more weight
    values, for compatibility with the GTK font selection widget
    (see gtkutil.c:XG_WEIGHT_TO_SYMBOL).  (Bug#24226)
---
 src/w32font.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/w32font.c b/src/w32font.c
index 9a33471..60020ea 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -2000,11 +2000,14 @@ w32_encode_weight (int n)
 static Lisp_Object
 w32_to_fc_weight (int n)
 {
-  if (n >= FW_EXTRABOLD) return intern ("black");
+  if (n >= FW_HEAVY)     return intern ("black");
+  if (n >= FW_EXTRABOLD) return Qextra_bold;
   if (n >= FW_BOLD)      return Qbold;
   if (n >= FW_SEMIBOLD)  return intern ("demibold");
   if (n >= FW_NORMAL)    return intern ("medium");
-  return Qlight;
+  if (n >= FW_LIGHT)     return Qlight;
+  if (n >= FW_EXTRALIGHT) return Qextra_light;
+  return intern ("thin");
 }
 
 /* Fill in all the available details of LOGFONT from FONT_SPEC.  */



reply via email to

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