From 2641e21320c3bcbe7068aee246b8fca4ffef21c4 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 24 Jun 2008 07:01:27 +0000 Subject: [PATCH] (font_score): Even if the PIXEL_SIZE is the same, check DPI too. (font_sort_entites): Setup prefer_prop[FONT_DPI_INDEX] too. --- src/font.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/font.c b/src/font.c index b49fde8cb7e..4d8c9725844 100644 --- a/src/font.c +++ b/src/font.c @@ -2212,8 +2212,7 @@ font_score (entity, spec_prop) /* Score the size. Maximum difference is 127. */ i = FONT_SIZE_INDEX; - if (! NILP (spec_prop[i]) && ! EQ (AREF (entity, i), spec_prop[i]) - && XINT (AREF (entity, i)) > 0) + if (! NILP (spec_prop[i]) && XINT (AREF (entity, i)) > 0) { /* We use the higher 6-bit for the actual size difference. The lowest bit is set if the DPI is different. */ @@ -2278,7 +2277,7 @@ font_sort_entites (vec, prefer, frame, spec, best_only) if (len <= 1) return best_only ? AREF (vec, 0) : vec; - for (i = FONT_WEIGHT_INDEX; i <= FONT_SIZE_INDEX; i++) + for (i = FONT_WEIGHT_INDEX; i <= FONT_DPI_INDEX; i++) prefer_prop[i] = AREF (prefer, i); if (! NILP (spec)) -- 2.39.2