changeset 109287:a18863f338c2

Check FC_DUAL too. For such fonts, check width one by one (Bug#4129). * xftfont.c (xftfont_open): Check font width one by one also when spacing is dual. * ftfont.c (ftfont_open): Ditto.
author Chong Yidong <cyd@stupidchicken.com>
date Wed, 30 Jun 2010 10:22:18 -0400
parents 72670994a836
children e24d55cee016
files src/ChangeLog src/ftfont.c src/xftfont.c
diffstat 3 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Jun 29 22:41:04 2010 +0200
+++ b/src/ChangeLog	Wed Jun 30 10:22:18 2010 -0400
@@ -1,3 +1,10 @@
+2010-06-30  Naohiro Aota  <naota@elisp.net>  (tiny change)
+
+	* xftfont.c (xftfont_open): Check font width one by one also when
+	spacing is dual.
+
+	* ftfont.c (ftfont_open): Ditto.
+
 2010-06-26  Andreas Schwab  <schwab@linux-m68k.org>
 
 	* alloc.c (Fmake_byte_code): Don't access undefined argument
--- a/src/ftfont.c	Tue Jun 29 22:41:04 2010 +0200
+++ b/src/ftfont.c	Wed Jun 30 10:22:18 2010 -0400
@@ -1262,7 +1262,7 @@
     spacing = XINT (AREF (entity, FONT_SPACING_INDEX));
   else
     spacing = FC_PROPORTIONAL;
-  if (spacing != FC_PROPORTIONAL)
+  if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL)
     font->min_width = font->average_width = font->space_width
       = (scalable ? ft_face->max_advance_width * size / upEM
 	 : ft_face->size->metrics.max_advance >> 6);
--- a/src/xftfont.c	Tue Jun 29 22:41:04 2010 +0200
+++ b/src/xftfont.c	Wed Jun 30 10:22:18 2010 -0400
@@ -429,7 +429,7 @@
 	ascii_printable[i] = ' ' + i;
     }
   BLOCK_INPUT;
-  if (spacing != FC_PROPORTIONAL)
+  if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL)
     {
       font->min_width = font->average_width = font->space_width
 	= xftfont->max_advance_width;