changeset 73385:bd82ccfce877

(mac_query_char_extents): Don't return glyph ID if layout adjustment is needed. (mac_load_query_font): Check if width and height are positive.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Mon, 16 Oct 2006 08:59:08 +0000
parents c5a4a949a307
children cdd23e558cd8
files src/macterm.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/macterm.c	Mon Oct 16 08:58:39 2006 +0000
+++ b/src/macterm.c	Mon Oct 16 08:59:08 2006 +0000
@@ -1198,7 +1198,12 @@
 		err1 = ATSUGetGlyphInfo (text_layout, kATSUFromTextBeginning,
 					 kATSUToTextEnd, &count,
 					 &glyph_info_array);
-	      if (err1 == noErr)
+	      if (err1 == noErr
+		  /* Make sure that we don't have to make layout
+		     adjustments.  */
+		  && glyph_info_array.glyphs[0].deltaY == 0.0f
+		  && glyph_info_array.glyphs[0].idealX == 0.0f
+		  && glyph_info_array.glyphs[0].screenX == 0)
 		{
 		  xassert (glyph_info_array.glyphs[0].glyphID);
 		  *cg_glyph = glyph_info_array.glyphs[0].glyphID;
@@ -7963,7 +7968,8 @@
 				    NULL
 #endif
 				    );
-      if (err != noErr)
+      if (err != noErr
+	  || space_bounds->width <= 0 || FONT_HEIGHT (font) <= 0)
 	{
 	  mac_unload_font (&one_mac_display_info, font);
 	  return NULL;