]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix inconsistencies in Haiku font selection dialog
authorPo Lu <luangruo@yahoo.com>
Mon, 2 May 2022 09:05:12 +0000 (09:05 +0000)
committerPo Lu <luangruo@yahoo.com>
Mon, 2 May 2022 09:05:40 +0000 (09:05 +0000)
* 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
src/haikufont.c

index 1156f0bced225a10732bdf9a80d5dffa15c80184..cc4eba5c294bd1f54a19ccbe80847deedb151329 100644 (file)
@@ -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)
index db2ba326e048bfe393788cfcd2aa1b2abac41736..cf7cc83085af079311b7cb0eafcc82131892a4cf 100644 (file)
@@ -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);
     }
 }