changeset 96831:47bb47a5494d

restore ability under NS to change font size from font panel (lost during some recent font backend refactoring)
author Adrian Robert <Adrian.B.Robert@gmail.com>
date Sun, 20 Jul 2008 00:47:28 +0000
parents a8aac59d9c7a
children f6418143551e
files src/ChangeLog src/font.c src/frame.c src/nsterm.m
diffstat 4 files changed, 33 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sun Jul 20 00:37:45 2008 +0000
+++ b/src/ChangeLog	Sun Jul 20 00:47:28 2008 +0000
@@ -1,3 +1,20 @@
+2008-07-19  Adrian Robert  <Adrian.B.Robert@gmail.com>
+
+	* font.c (font_open_by_name): Under NS, default lface height to zero.
+	(font_open_for_lface): Under NS, set size based on frame fontsize.
+	* nsterm.m (EmacsView-changeFont:): Remove some commented code.
+	* frame.c (x_set_frame_parameters): Remove HAVE_NS ifdef.
+
+2008-07-19  Adrian Robert  <Adrian.B.Robert@gmail.com>
+
+	* nsterm.m (ns_antialias_text, ns_use_qd_smoothing)
+	(ns_use_system_highlight_color): Switch these from DEFVAR_BOOL to
+	DEFVAR_LISP and change all code accordingly to use Qt/Qnil instead of
+	YES/NO.
+	* nsterm.h (prevUseHighlightColor): Make a Lisp_Object.
+	* nsfont.m (nsfont_draw): Treat ns_use_qd_smoothing as Lisp_Object.
+	* Makefile.in (clean): Clear out build destination dir.
+
 2008-07-19  Adrian Robert  <Adrian.B.Robert@gmail.com>
 
 	* Makefile.in (nsgui.h-related dependencies): Remove abbrev, xfns,
--- a/src/font.c	Sun Jul 20 00:37:45 2008 +0000
+++ b/src/font.c	Sun Jul 20 00:47:28 2008 +0000
@@ -55,6 +55,10 @@
 #endif /* MAC_OS */
 
 Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;
+ 
+#ifdef HAVE_NS
+extern Lisp_Object Qfontsize;
+#endif
 
 Lisp_Object Qopentype;
 
@@ -3316,6 +3320,13 @@
 
       pt /= 10;
       size = POINT_TO_PIXEL (pt, f->resy);
+#ifdef HAVE_NS
+      if (size == 0)
+        {
+          Lisp_Object ffsize = get_frame_param(f, Qfontsize);
+          size = NUMBERP (ffsize) ? POINT_TO_PIXEL (XINT (ffsize), f->resy) : 0;
+        }
+#endif
     }
   return font_open_entity (f, entity, size);
 }
@@ -3390,7 +3401,11 @@
   attrs[LFACE_FAMILY_INDEX] = attrs[LFACE_FOUNDRY_INDEX] = Qnil;
   attrs[LFACE_SWIDTH_INDEX] = attrs[LFACE_WEIGHT_INDEX]
     = attrs[LFACE_SLANT_INDEX] = Qnormal;
+#ifndef HAVE_NS
   attrs[LFACE_HEIGHT_INDEX] = make_number (120);
+#else
+  attrs[LFACE_HEIGHT_INDEX] = make_number (0);
+#endif
   attrs[LFACE_FONT_INDEX] = Qnil;
 
   return font_load_for_lface (f, attrs, spec);
--- a/src/frame.c	Sun Jul 20 00:37:45 2008 +0000
+++ b/src/frame.c	Sun Jul 20 00:47:28 2008 +0000
@@ -2986,9 +2986,7 @@
 
 	  old_value = get_frame_param (f, prop);
  	  fullscreen_is_being_set |= EQ (prop, Qfullscreen);
-#ifndef HAVE_NS  /* XXX: ensure font attrs change goes through */
 	  if (NILP (Fequal (val, old_value)))
-#endif
 	    {
 	      store_frame_param (f, prop, val);
 
--- a/src/nsterm.m	Sun Jul 20 00:37:45 2008 +0000
+++ b/src/nsterm.m	Sun Jul 20 00:47:28 2008 +0000
@@ -4441,11 +4441,7 @@
       emacs_event->code = KEY_NS_CHANGE_FONT;
 
       size = [newFont pointSize];
-      /* PENDING: stick w/integer sizes for now. */
-/*        if (size == lrint (size)) */
-        ns_input_fontsize = make_number (lrint (size));
-/*          else
-            ns_input_fontsize = make_float (size); */
+      ns_input_fontsize = make_number (lrint (size));
       ns_input_font = build_string ([[newFont familyName] UTF8String]);
       EV_TRAILER (e);
     }