[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r112404: font.c (font_open_entity): A
From: |
K. Handa |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r112404: font.c (font_open_entity): Always open a font of manageable size. |
Date: |
Sat, 27 Apr 2013 22:36:37 +0900 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 112404 [merge]
committer: K. Handa <address@hidden>
branch nick: trunk
timestamp: Sat 2013-04-27 22:36:37 +0900
message:
font.c (font_open_entity): Always open a font of manageable size.
modified:
src/ChangeLog
src/font.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2013-04-26 19:31:09 +0000
+++ b/src/ChangeLog 2013-04-27 13:34:02 +0000
@@ -1,5 +1,9 @@
+2013-04-27 Kenichi Handa <address@hidden>
+
+ * font.c (font_open_entity): Always open a font of manageable
+ size.
+
2013-04-26 Paul Eggert <address@hidden>
-
Port better to AIX (Bug#14258).
* lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
to pacify AIX xlc.
=== modified file 'src/font.c'
--- a/src/font.c 2013-04-07 04:41:19 +0000
+++ b/src/font.c 2013-04-27 13:32:24 +0000
@@ -2819,7 +2819,7 @@
struct font_driver_list *driver_list;
Lisp_Object objlist, size, val, font_object;
struct font *font;
- int min_width, height;
+ int min_width, height, psize;
eassert (FONT_ENTITY_P (entity));
size = AREF (entity, FONT_SIZE_INDEX);
@@ -2846,12 +2846,19 @@
}
}
- font_object = driver_list->driver->open (f, entity, pixel_size);
- if (!NILP (font_object))
- ASET (font_object, FONT_SIZE_INDEX, make_number (pixel_size));
+ /* We always open a font of manageable size; i.e non-zero average
+ width and height. */
+ for (psize = pixel_size; ; psize++)
+ {
+ font_object = driver_list->driver->open (f, entity, psize);
+ if (NILP (font_object))
+ return Qnil;
+ font = XFONT_OBJECT (font_object);
+ if (font->average_width > 0 && font->height > 0)
+ break;
+ }
+ ASET (font_object, FONT_SIZE_INDEX, make_number (pixel_size));
FONT_ADD_LOG ("open", entity, font_object);
- if (NILP (font_object))
- return Qnil;
ASET (entity, FONT_OBJLIST_INDEX,
Fcons (font_object, AREF (entity, FONT_OBJLIST_INDEX)));
@@ -3118,6 +3125,8 @@
double pt = XINT (attrs[LFACE_HEIGHT_INDEX]);
pixel_size = POINT_TO_PIXEL (pt / 10, FRAME_RES_Y (f));
+ if (pixel_size < 1)
+ pixel_size = 1;
}
ASET (work, FONT_SIZE_INDEX, Qnil);
foundry[0] = AREF (work, FONT_FOUNDRY_INDEX);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r112404: font.c (font_open_entity): Always open a font of manageable size.,
K. Handa <=