emacs-diffs
[Top][All Lists]
Advanced

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

master 3894522559: Fix inconsistencies in Haiku font selection dialog


From: Po Lu
Subject: master 3894522559: Fix inconsistencies in Haiku font selection dialog
Date: Mon, 2 May 2022 05:06:01 -0400 (EDT)

branch: master
commit 38945225596708a60d332d1f95dc9618e3d974b1
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix inconsistencies in Haiku font selection dialog
    
    * src/haiku_font_support.cc (font_family_style_matches_p): Fix
    coding style.
    * src/haikufont.c (haikufont_pattern_from_object): Set slant and
    width using correct object.
---
 src/haiku_font_support.cc | 12 +++++++-----
 src/haikufont.c           |  4 ++--
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/haiku_font_support.cc b/src/haiku_font_support.cc
index 1156f0bced..cc4eba5c29 100644
--- a/src/haiku_font_support.cc
+++ b/src/haiku_font_support.cc
@@ -494,8 +494,8 @@ font_family_style_matches_p (font_family family, char 
*style, uint32_t flags,
       strcmp ((char *) &pattern->family, family))
     return false;
 
-  if (!ignore_flags_p && (pattern->specified & FSPEC_SPACING) &&
-      !(pattern->mono_spacing_p) != !(flags & B_IS_FIXED))
+  if (!ignore_flags_p && (pattern->specified & FSPEC_SPACING)
+      && !(pattern->mono_spacing_p) != !(flags & B_IS_FIXED))
     return false;
 
   if (pattern->specified & FSPEC_STYLE)
@@ -508,7 +508,8 @@ font_family_style_matches_p (font_family family, char 
*style, uint32_t flags,
 
   if ((pattern->specified & FSPEC_SLANT)
       && (pattern->slant
-         != ((m.specified & FSPEC_SLANT) ? m.slant : SLANT_REGULAR)))
+         != (m.specified & FSPEC_SLANT
+             ? m.slant : SLANT_REGULAR)))
     return false;
 
   if ((pattern->specified & FSPEC_WANTED)
@@ -516,8 +517,9 @@ font_family_style_matches_p (font_family family, char 
*style, uint32_t flags,
     return false;
 
   if ((pattern->specified & FSPEC_WIDTH)
-      && (pattern->width !=
-         ((m.specified & FSPEC_WIDTH) ? m.width : NORMAL_WIDTH)))
+      && (pattern->width
+         != (m.specified & FSPEC_WIDTH
+             ? m.width : NORMAL_WIDTH)))
     return false;
 
   if ((pattern->specified & FSPEC_NEED_ONE_OF)
diff --git a/src/haikufont.c b/src/haikufont.c
index db2ba326e0..cf7cc83085 100644
--- a/src/haikufont.c
+++ b/src/haikufont.c
@@ -460,14 +460,14 @@ haikufont_pattern_from_object (struct haiku_font_pattern 
*pattern,
   if (!NILP (val) && !EQ (val, Qunspecified))
     {
       pattern->specified |= FSPEC_SLANT;
-      pattern->slant = haikufont_lisp_to_slant (font_object);
+      pattern->slant = haikufont_lisp_to_slant (val);
     }
 
   val = FONT_WIDTH_FOR_FACE (font_object);
   if (!NILP (val) && !EQ (val, Qunspecified))
     {
       pattern->specified |= FSPEC_WIDTH;
-      pattern->width = haikufont_lisp_to_width (font_object);
+      pattern->width = haikufont_lisp_to_width (val);
     }
 }
 



reply via email to

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