]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix some font parsing problems on NS
authorPo Lu <luangruo@yahoo.com>
Tue, 3 May 2022 08:02:02 +0000 (16:02 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 3 May 2022 08:02:02 +0000 (16:02 +0800)
* src/nsterm.m (ns_font_desc_to_font_spec): Fix processing of
condensed width.

src/nsterm.m

index 21232f55ad50867ff122cde403001170d44f850d..7deafc8cbb38466264bf7d27a99446909b0d2a4d 100644 (file)
@@ -6102,7 +6102,7 @@ ns_font_desc_to_font_spec (NSFontDescriptor *desc, NSFont *font)
       if (tem != nil)
        lwidth = ([tem floatValue] > 0
                  ? Qexpanded : ([tem floatValue] < 0
-                                ? Qnormal : Qcondensed));
+                                ? Qcondensed : Qnormal));
     }
 
   lheight = make_float ([font pointSize]);
@@ -6110,7 +6110,9 @@ ns_font_desc_to_font_spec (NSFontDescriptor *desc, NSFont *font)
   return CALLN (Ffont_spec,
                QCwidth, lwidth, QCslant, lslant,
                QCweight, lweight, QCsize, lheight,
-               QCfamily, [family lispString]);
+               QCfamily, (family
+                          ? [family lispString]
+                          : Qnil));
 }
 
 /* ==========================================================================