aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2014-07-20 00:18:23 +0900
committerKenichi Handa2014-07-20 00:18:23 +0900
commitbf0d3f76dcfe7881cb3058169b51cf6602fdcdcb (patch)
tree4d4c958973053b9c4427272c204b5e21fb03f89c /src
parent31ca1841d2e25983fbcc44302ee9eff0b3a1554a (diff)
downloademacs-bf0d3f76dcfe7881cb3058169b51cf6602fdcdcb.tar.gz
emacs-bf0d3f76dcfe7881cb3058169b51cf6602fdcdcb.zip
2014-07-19 Kenichi Handa <handa@gnu.org>
* xfaces.c (realize_x_face): Call font_load_for_lface with no mandatory font spec (Bug#17973). 2014-07-19 Stefan Monnier <monnier@iro.umontreal.ca> * font.c (font_score): Return the worst score if the size of ENTITY is wrong by more than a factor 2 (Bug#17973).
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/font.c6
-rw-r--r--src/xfaces.c2
3 files changed, 16 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7d244db6b1d..51569f14f31 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12014-07-19 K. Handa <handa@gnu.org>
2
3 * xfaces.c (realize_x_face): Call font_load_for_lface with no
4 mandatory font spec (Bug#17973).
5
62014-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
7
8 * font.c (font_score): Return the worst score if the size of
9 ENTITY is wrong by more than a factor 2 (Bug#17973).
10
12014-07-18 Dmitry Antipov <dmantipov@yandex.ru> 112014-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2 12
3 * frame.c (frame_unspecified_color): New function 13 * frame.c (frame_unspecified_color): New function
diff --git a/src/font.c b/src/font.c
index ef8b5e40eeb..054a68bfd94 100644
--- a/src/font.c
+++ b/src/font.c
@@ -2158,10 +2158,14 @@ font_score (Lisp_Object entity, Lisp_Object *spec_prop)
2158 lowest bit is set if the DPI is different. */ 2158 lowest bit is set if the DPI is different. */
2159 EMACS_INT diff; 2159 EMACS_INT diff;
2160 EMACS_INT pixel_size = XINT (spec_prop[FONT_SIZE_INDEX]); 2160 EMACS_INT pixel_size = XINT (spec_prop[FONT_SIZE_INDEX]);
2161 EMACS_INT entity_size = XINT (AREF (entity, FONT_SIZE_INDEX));
2161 2162
2162 if (CONSP (Vface_font_rescale_alist)) 2163 if (CONSP (Vface_font_rescale_alist))
2163 pixel_size *= font_rescale_ratio (entity); 2164 pixel_size *= font_rescale_ratio (entity);
2164 diff = eabs (pixel_size - XINT (AREF (entity, FONT_SIZE_INDEX))) << 1; 2165 if (pixel_size * 2 < entity_size || entity_size * 2 < pixel_size)
2166 /* This size is wrong by more than a factor 2: reject it! */
2167 return 0xFFFFFFFF;
2168 diff = eabs (pixel_size - entity_size) << 1;
2165 if (! NILP (spec_prop[FONT_DPI_INDEX]) 2169 if (! NILP (spec_prop[FONT_DPI_INDEX])
2166 && ! EQ (spec_prop[FONT_DPI_INDEX], AREF (entity, FONT_DPI_INDEX))) 2170 && ! EQ (spec_prop[FONT_DPI_INDEX], AREF (entity, FONT_DPI_INDEX)))
2167 diff |= 1; 2171 diff |= 1;
diff --git a/src/xfaces.c b/src/xfaces.c
index 081875f5bea..34895123db9 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -5547,7 +5547,7 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE])
5547 } 5547 }
5548 if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) 5548 if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))
5549 attrs[LFACE_FONT_INDEX] 5549 attrs[LFACE_FONT_INDEX]
5550 = font_load_for_lface (f, attrs, attrs[LFACE_FONT_INDEX]); 5550 = font_load_for_lface (f, attrs, Ffont_spec (0, NULL));
5551 if (FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) 5551 if (FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))
5552 { 5552 {
5553 face->font = XFONT_OBJECT (attrs[LFACE_FONT_INDEX]); 5553 face->font = XFONT_OBJECT (attrs[LFACE_FONT_INDEX]);