rpms/emacs/F-12 emacs-23.1-fontdpi.patch, NONE, 1.1 emacs.spec, 1.145, 1.146

Karel Klíč kklic at fedoraproject.org
Mon Jan 4 11:30:37 UTC 2010


Author: kklic

Update of /cvs/extras/rpms/emacs/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv15928

Modified Files:
	emacs.spec 
Added Files:
	emacs-23.1-fontdpi.patch 
Log Message:
Fix for #517272

emacs-23.1-fontdpi.patch:
 xterm.c |   32 +++++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

--- NEW FILE emacs-23.1-fontdpi.patch ---
diff -up emacs-23.1/src/xterm.c.fontdpi emacs-23.1/src/xterm.c
--- emacs-23.1/src/xterm.c.fontdpi	2010-01-04 09:11:45.000000000 +0100
+++ emacs-23.1/src/xterm.c	2010-01-04 11:50:19.627777180 +0100
@@ -10380,17 +10380,31 @@ x_term_init (display_name, xrm_option, r
 				     dpyinfo->visual, AllocNone);
 
   {
-    int screen_number = XScreenNumberOfScreen (dpyinfo->screen);
-    double pixels = DisplayHeight (dpyinfo->display, screen_number);
-    double mm = DisplayHeightMM (dpyinfo->display, screen_number);
-    /* Mac OS X 10.3's Xserver sometimes reports 0.0mm.  */
-    dpyinfo->resy = (mm < 1) ? 100 : pixels * 25.4 / mm;
-    pixels = DisplayWidth (dpyinfo->display, screen_number);
-    mm = DisplayWidthMM (dpyinfo->display, screen_number);
-    /* Mac OS X 10.3's Xserver sometimes reports 0.0mm.  */
-    dpyinfo->resx = (mm < 1) ? 100 : pixels * 25.4 / mm;
+    /* If we are using Xft, check dpi value in X resources.
+       It is better we use it as well, since Xft will use it, as will all
+       Gnome applications. If our real DPI is smaller or larger than the
+       one Xft uses, our font will look smaller or larger than other
+       for other applications, even if it is the same font name (monospace-10
+       for example). */
+    char *v = XGetDefault (dpyinfo->display, "Xft", "dpi");
+    double d;
+    if (v != NULL && sscanf (v, "%lf", &d) == 1)
+      dpyinfo->resy = dpyinfo->resx = d;
   }
 
+  if (dpyinfo->resy < 1)
+    {
+      int screen_number = XScreenNumberOfScreen (dpyinfo->screen);
+      double pixels = DisplayHeight (dpyinfo->display, screen_number);
+      double mm = DisplayHeightMM (dpyinfo->display, screen_number);
+      /* Mac OS X 10.3's Xserver sometimes reports 0.0mm. */
+      dpyinfo->resy = (mm < 1) ? 100 : pixels * 25.4 / mm;
+      pixels = DisplayWidth (dpyinfo->display, screen_number);
+      mm = DisplayWidthMM (dpyinfo->display, screen_number);
+      /* Mac OS X 10.3's Xserver sometimes reports 0.0mm. */
+      dpyinfo->resx = (mm < 1) ? 100 : pixels * 25.4 / mm;
+    }
+
   dpyinfo->Xatom_wm_protocols
     = XInternAtom (dpyinfo->display, "WM_PROTOCOLS", False);
   dpyinfo->Xatom_wm_take_focus


Index: emacs.spec
===================================================================
RCS file: /cvs/extras/rpms/emacs/F-12/emacs.spec,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -p -r1.145 -r1.146
--- emacs.spec	8 Dec 2009 17:13:54 -0000	1.145
+++ emacs.spec	4 Jan 2010 11:30:37 -0000	1.146
@@ -4,7 +4,7 @@ Summary: GNU Emacs text editor
 Name: emacs
 Epoch: 1
 Version: 23.1
-Release: 15%{?dist}
+Release: 16%{?dist}
 License: GPLv3+
 URL: http://www.gnu.org/software/emacs/
 Group: Applications/Editors
@@ -32,6 +32,7 @@ Patch6: emacs-23.1-cpp.patch
 Patch7: emacs-23.1-scroll.patch
 Patch8: emacs-23.1-indian.patch
 Patch9: emacs-23.1-memmove.patch
+Patch10: emacs-23.1-fontdpi.patch
 
 Buildroot: %{_tmppath}/%{name}-%{version}-root
 BuildRequires: atk-devel, cairo-devel, desktop-file-utils, freetype-devel, fontconfig-devel, dbus-devel, giflib-devel, glibc-devel, gtk2-devel, libpng-devel
@@ -128,6 +129,7 @@ Emacs packages or see some elisp example
 %patch7 -p1 -b .scroll
 %patch8 -p1
 %patch9 -p1 -b .memmove
+%patch10 -p1 -b .fontdpi
 
 # install rest of site-lisp files
 ( cd site-lisp
@@ -390,6 +392,9 @@ alternatives --install %{_bindir}/etags 
 %dir %{_datadir}/emacs/%{version}
 
 %changelog
+* Mon Jan  4 2009 Karel Klic <kklic at redhat.com> 1:23.1-16
+- Fixed rhbz#517272 - emacs-23.1 update shows fonts in double the normal size
+
 * Tue Dec  8 2009 Karel Klic <kklic at redhat.com> 1:23.1-15
 - Fixed rhbz#545398 - ETags messes up filenames
 




More information about the fedora-extras-commits mailing list