emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117551: 2014-07-19 K. Handa <address@hidden>


From: Kenichi Handa
Subject: [Emacs-diffs] trunk r117551: 2014-07-19 K. Handa <address@hidden>
Date: Sat, 19 Jul 2014 15:24:05 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117551 [merge]
revision-id: address@hidden
parent: address@hidden
parent: address@hidden
committer: K. Handa <address@hidden>
branch nick: trunk
timestamp: Sun 2014-07-20 00:23:57 +0900
message:
  2014-07-19  K. Handa  <address@hidden>
  
        * xfaces.c (realize_x_face): Call font_load_for_lface with no
        mandatory font spec (Bug#17973).
  
  2014-07-19  Stefan Monnier  <address@hidden>
  
        * font.c (font_score): Return the worst score if the size of
        ENTITY is wrong by more than a factor 2 (Bug#17973).
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/font.c                     font.c-20091113204419-o5vbwnq5f7feedwu-8540
  src/xfaces.c                   xfaces.c-20091113204419-o5vbwnq5f7feedwu-560
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-07-18 11:04:37 +0000
+++ b/src/ChangeLog     2014-07-19 15:18:23 +0000
@@ -1,3 +1,13 @@
+2014-07-19  K. Handa  <address@hidden>
+
+       * xfaces.c (realize_x_face): Call font_load_for_lface with no
+       mandatory font spec (Bug#17973).
+
+2014-07-19  Stefan Monnier  <address@hidden>
+
+       * font.c (font_score): Return the worst score if the size of
+       ENTITY is wrong by more than a factor 2 (Bug#17973).
+
 2014-07-18  Dmitry Antipov  <address@hidden>
 
        * frame.c (frame_unspecified_color): New function

=== modified file 'src/font.c'
--- a/src/font.c        2014-07-16 15:39:15 +0000
+++ b/src/font.c        2014-07-19 15:18:23 +0000
@@ -2158,10 +2158,14 @@
         lowest bit is set if the DPI is different.  */
       EMACS_INT diff;
       EMACS_INT pixel_size = XINT (spec_prop[FONT_SIZE_INDEX]);
+      EMACS_INT entity_size = XINT (AREF (entity, FONT_SIZE_INDEX));
 
       if (CONSP (Vface_font_rescale_alist))
        pixel_size *= font_rescale_ratio (entity);
-      diff = eabs (pixel_size - XINT (AREF (entity, FONT_SIZE_INDEX))) << 1;
+      if (pixel_size * 2 < entity_size || entity_size * 2 < pixel_size)
+       /* This size is wrong by more than a factor 2: reject it!  */
+       return 0xFFFFFFFF;
+      diff = eabs (pixel_size - entity_size) << 1;
       if (! NILP (spec_prop[FONT_DPI_INDEX])
          && ! EQ (spec_prop[FONT_DPI_INDEX], AREF (entity, FONT_DPI_INDEX)))
        diff |= 1;

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2014-07-07 23:33:05 +0000
+++ b/src/xfaces.c      2014-07-19 15:18:23 +0000
@@ -5547,7 +5547,7 @@
        }
       if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))
        attrs[LFACE_FONT_INDEX]
-         = font_load_for_lface (f, attrs, attrs[LFACE_FONT_INDEX]);
+         = font_load_for_lface (f, attrs, Ffont_spec (0, NULL));
       if (FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))
        {
          face->font = XFONT_OBJECT (attrs[LFACE_FONT_INDEX]);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]