Subject: bug#578 closed by Adrian Robert <[email-masked]> (#578 - 23.0.60; Cocoa, Font dialog doesn't set font size - Emacs bug report logs)

From: [email-masked] (Emacs bug Tracking System)

This is an automatic notification regarding your bug report
which was filed against the emacs,ns package:

#578: 23.0.60; Cocoa, Font dialog doesn't set font size

It has been closed by Adrian Robert <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Adrian Robert <[email-masked]> by
replying to this email.

-- 
578: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=578
Emacs Bug Tracking System
Contact [email-masked] with problems
>From [email-masked] Fri Oct  3 11:09:29 2008
From: Adrian Robert <[email-masked]>
To: [email-masked]
Subject: #578 - 23.0.60; Cocoa, Font dialog doesn't set font size - Emacs bug report logs
Date: Fri, 3 Oct 2008 14:08:46 -0400

This regression was resolved by a different change, by Adrian Robert  
on 2008-07-19 to restore some NS-specific functionality that was  
accidentally removed from font.c during the NS port merge.

>From [email-masked] Sat Jul 19 09:23:14 2008
From: Benjamin Riefenstahl <[email-masked]>
To: [email-masked]
Subject: 23.0.60; Cocoa, Font dialog doesn't set font size
Date: Sat, 19 Jul 2008 17:10:39 +0200

--=-=-=

In GNU Emacs 23.0.60.1 (powerpc-apple-darwin8.11.0, *Step 9.0)
 of 2008-07-19 on sueton.benny.turtle-trading.net
configured using `configure  '--with-ns' '--with-png' '--with-gif' '--with-jpeg' '--with-tiff''

When setting the font via the font dialog either from the menu item
"Set Default Font..." or from the preferenc es dialog, only the font
family, but not the font size is actually configured.

The attached patch fixes the problem by passing XLFDs around instead
of Mac font names and eliminating the "FontSize" parameter from the
defaults database.

2008-07-19  Benjamin Riefenstahl  <[email-masked]>

	* lisp/term/ns-win.el (ns-save-preferences): Do not save defaults
	 parameter "FontSize".
	 (ns-respond-to-change-font): Construct an XLFD to pass to
	 set-frame-font.
	* src/nsfns.m (Fns_create_frame): Do not use defaults parameter
	"FontSize".

--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=fontsize.diff

Index: src/nsfns.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsfns.m,v
retrieving revision 1.6
diff -u -p -r1.6 nsfns.m
--- src/nsfns.m	17 Jul 2008 13:50:27 -0000	1.6
+++ src/nsfns.m	19 Jul 2008 13:48:28 -0000
@@ -1180,9 +1181,6 @@ be shared by the new frame.")
   {
     /* use for default font name */
     id font = [NSFont userFixedPitchFontOfSize: -1.0]; /* default */
-    tfontsize = x_default_parameter (f, parms, Qfontsize,
-                                    make_number (0 /*(int)[font pointSize]*/),
-                                    "fontSize", "FontSize", RES_TYPE_NUMBER);
     tfont = x_default_parameter (f, parms, Qfont,
                                  build_string ([[font fontName] UTF8String]),
                                  "font", "Font", RES_TYPE_STRING);
Index: lisp/term/ns-win.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/term/ns-win.el,v
retrieving revision 1.11
diff -u -p -r1.11 ns-win.el
--- lisp/term/ns-win.el	19 Jul 2008 01:15:10 -0000	1.11
+++ lisp/term/ns-win.el	19 Jul 2008 13:48:29 -0000
@@ -1038,9 +1038,7 @@ Lines are highlighted according to `ns-i
   (let ((p (frame-parameters))
 	v)
     (if (setq v (assq 'font p))
-	(ns-set-resource nil "Font" (ns-font-name (cdr v))))
-    (if (setq v (assq 'fontsize p))
-	(ns-set-resource nil "FontSize" (number-to-string (cdr v))))
+	(ns-set-resource nil "Font" (cdr v)))
     (if (setq v (assq 'foreground-color p))
 	(ns-set-resource nil "Foreground" (cdr v)))
     (if (setq v (assq 'background-color p))
@@ -1325,10 +1322,9 @@ cursor display.  On a text-only terminal
   "Respond to changeFont: event, expecting ns-input-font and\n\
 ns-input-fontsize of new font."
   (interactive)
-  (modify-frame-parameters (selected-frame)
-                           (list (cons 'font ns-input-font)
-                                 (cons 'fontsize ns-input-fontsize)))
-  (set-frame-font ns-input-font))
+  (set-frame-font
+   (font-xlfd-name
+    (font-spec :family ns-input-font :size (float ns-input-fontsize)))))

 ;; Default fontset for Mac OS X.  This is mainly here to show how a fontset

--=-=-=--