SHA256
1
0
forked from pool/emacs

Accepting request 447392 from editors

- Add patch emacs-25.1-custom-fonts.patch as workaround for boo#1016172

OBS-URL: https://build.opensuse.org/request/show/447392
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/emacs?expand=0&rev=127
This commit is contained in:
Ludwig Nussel 2016-12-26 20:38:07 +00:00 committed by Git OBS Bridge
commit f71a85c1b7
3 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,83 @@
Work around openSUSE bug #1016172
--
lisp/dynamic-setting.el | 29 +++++++++++++++--------------
src/xsettings.c | 7 ++++++-
2 files changed, 21 insertions(+), 15 deletions(-)
--- lisp/dynamic-setting.el
+++ lisp/dynamic-setting.el 2016-12-20 16:51:49.533433283 +0000
@@ -33,6 +33,7 @@
;;; Customizable variables
(declare-function font-get-system-font "xsettings.c" ())
+(declare-function font-face-attributes "font.c" (font &optional frame))
(defvar font-use-system-font)
@@ -42,28 +43,28 @@ If DISPLAY-OR-FRAME is a frame, the disp
If SET-FONT is non-nil, change the font for frames. Otherwise re-apply the
current form for the frame (i.e. hinting or somesuch changed)."
- (let ((new-font (and (fboundp 'font-get-system-font)
- (font-get-system-font)))
- (frame-list (frames-on-display-list display-or-frame)))
- (when (and new-font (display-graphic-p display-or-frame))
+ (let ((system-font (and (fboundp 'font-get-system-font)
+ (font-get-system-font)))
+ (frame-list (frames-on-display-list display-or-frame))
+ (user-font (face-attribute 'default :font)))
+ (when (and system-font (display-graphic-p display-or-frame))
(clear-font-cache)
(if set-font
;; Set the font on all current and future frames, as though
;; the `default' face had been "set for this session":
- (set-frame-font new-font nil frame-list)
+ (if (not user-font)
+ (set-frame-font system-font nil frame-list)
+ (set-frame-font user-font nil frame-list))
;; Just redraw the existing fonts on all frames:
(dolist (f frame-list)
- (let ((frame-font
- (or (font-get (face-attribute 'default :font f 'default)
- :user-spec)
- (frame-parameter f 'font-parameter))))
+ ;; (apply 'font-spec (font-face-attributes (font-get-system-font)))
+ (let* ((frame-font
+ (or (face-attribute 'default :font f 'default)
+ (frame-parameter f 'font-parameter)))
+ (font-attr (font-face-attributes frame-font)))
(when frame-font
(set-frame-parameter f 'font-parameter frame-font)
- (set-face-attribute 'default f
- :width 'normal
- :weight 'normal
- :slant 'normal
- :font frame-font))))))))
+ (apply #'set-face-attribute 'default f font-attr))))))))
(defun dynamic-setting-handle-config-changed-event (event)
"Handle config-changed-event on the display in EVENT.
--- src/xsettings.c
+++ src/xsettings.c 2016-12-21 07:25:17.605036477 +0000
@@ -45,6 +45,7 @@ along with GNU Emacs. If not, see <http
#endif
#ifdef HAVE_XFT
+#include <math.h>
#include <X11/Xft/Xft.h>
#endif
@@ -620,7 +621,11 @@ apply_xft_settings (struct x_display_inf
#endif
FcPatternGetInteger (pat, FC_LCD_FILTER, 0, &oldsettings.lcdfilter);
FcPatternGetInteger (pat, FC_RGBA, 0, &oldsettings.rgba);
- FcPatternGetDouble (pat, FC_DPI, 0, &oldsettings.dpi);
+
+ if (FcPatternGetDouble (pat, FC_DPI, 0, &oldsettings.dpi) == FcResultMatch)
+ {
+ oldsettings.dpi = round(oldsettings.dpi);
+ }
if ((settings->seen & SEEN_AA) != 0 && oldsettings.aa != settings->aa)
{

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Dec 20 16:10:47 UTC 2016 - werner@suse.de
- Add patch emacs-25.1-custom-fonts.patch as workaround for boo#1016172
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Nov 11 09:01:36 UTC 2016 - werner@suse.de Fri Nov 11 09:01:36 UTC 2016 - werner@suse.de

View File

@ -119,6 +119,7 @@ Patch12: emacs-24.3-x11r7.patch
Patch15: emacs-24.3-iconic.patch Patch15: emacs-24.3-iconic.patch
Patch16: emacs-24.4-flyspell.patch Patch16: emacs-24.4-flyspell.patch
Patch22: emacs-24.1-bnc628268.patch Patch22: emacs-24.1-bnc628268.patch
Patch23: emacs-25.1-custom-fonts.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{expand: %%global include_info %(test -s /usr/share/info/info.info* && echo 0 || echo 1)} %{expand: %%global include_info %(test -s /usr/share/info/info.info* && echo 0 || echo 1)}
@ -231,6 +232,7 @@ and most assembler-like syntaxes.
%patch15 -p0 -b .iconic %patch15 -p0 -b .iconic
%patch16 -p0 -b .flyspell %patch16 -p0 -b .flyspell
%patch22 -p0 -b .obsolate %patch22 -p0 -b .obsolate
%patch23 -p0 -b .custfnt
%patch -p0 -b .0 %patch -p0 -b .0
%if %{without autoconf} %if %{without autoconf}
@ -547,6 +549,7 @@ rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/speedbar.el.0
rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/textmodes/ispell.el.0 rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/textmodes/ispell.el.0
rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/epg.el.gnupg rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/epg.el.gnupg
rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/mouse.el.prime rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/mouse.el.prime
rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/dynamic-setting.el.custfnt
unelc %{buildroot}%{_datadir}/emacs/%{version}/lisp/bindings.elc unelc %{buildroot}%{_datadir}/emacs/%{version}/lisp/bindings.elc
unelc %{buildroot}%{_datadir}/emacs/%{version}/lisp/cus-start.elc unelc %{buildroot}%{_datadir}/emacs/%{version}/lisp/cus-start.elc
unelc %{buildroot}%{_datadir}/emacs/%{version}/lisp/generic-x.elc unelc %{buildroot}%{_datadir}/emacs/%{version}/lisp/generic-x.elc