Subject: bug#17534: AppleAntiAliasingThreshold default doesn't seem to work

From: David Logie <[email-masked]>
Date: Mon, 7 Jul 2014 16:17:42 +0100

This bug seems to have been introduced in r114295. A build from r114294
does not have the issue while a build from r114296 does.

Looking at the Mac port, I *think* a call to
`macfont_update_antialias_threshold()` has been missed somewhere.

I managed to cobble together a patch that works for me (see attached)
but I'm sure a more correct solution exists.
diff --git a/src/macfont.h b/src/macfont.h
index 8b45135..7421cd6 100644
--- a/src/macfont.h
+++ b/src/macfont.h
@@ -144,4 +144,5 @@ typedef const struct _EmacsScreenFont *ScreenFontRef; /* opaque */
 
 extern void mac_register_font_driver (struct frame *f);
 extern void *macfont_get_nsctfont (struct font *font);
+extern void macfont_update_antialias_threshold (void);
 
diff --git a/src/macfont.m b/src/macfont.m
index 82ee54c..024847b 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -728,7 +728,7 @@ static const struct
 
 static CGFloat macfont_antialias_threshold;
 
-static void
+void
 macfont_update_antialias_threshold (void)
 {
   int threshold;
diff --git a/src/nsterm.m b/src/nsterm.m
index f2eeeda..753afe9 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -4277,6 +4277,12 @@ ns_term_init (Lisp_Object display_name)
       ns_default ("AppleAntiAliasingThreshold", &tmp,
                  make_float (10.0), make_float (6.0), YES, NO);
       ns_antialias_threshold = NILP (tmp) ? 10.0 : XFLOATINT (tmp);
+
+#ifdef NS_IMPL_COCOA
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+      macfont_update_antialias_threshold();
+#endif
+#endif
     }
 
   {