]> git.eshelyaron.com Git - emacs.git/commitdiff
(mac_query_char_extents): Don't return glyph ID if layout
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Mon, 16 Oct 2006 08:59:31 +0000 (08:59 +0000)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Mon, 16 Oct 2006 08:59:31 +0000 (08:59 +0000)
adjustment is needed.
(mac_load_query_font): Check if width and height are positive.

src/ChangeLog
src/macterm.c

index 984407e44faeee34ef2f3ae9df8474468d668f08..4c79b1cfaa7c3871414bc9a9d80639091fe23bd6 100644 (file)
@@ -1,3 +1,16 @@
+2006-10-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * dispnew.c (adjust_frame_glyphs_for_frame_redisplay): Remove unused
+       variable ch_dim.
+       (adjust_frame_glyphs_for_window_redisplay): Likewise.  Don't allocate
+       menu bar window matrices on non-X systems.
+
+       * mac.c (Fmac_get_preference, Fmac_code_convert_string): Add GCPROs.
+
+       * macterm.c (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.
+
 2006-10-14  Richard Stallman  <rms@gnu.org>
 
        * sysdep.c (init_sys_modes): Delete DEFVAR_LISP in the wrong place.
index 86f4c46c4c6654accefa427ec7f9b394e16f1102..864852129e205973fc334f03c4d76ca5cf39145e 100644 (file)
@@ -1198,7 +1198,12 @@ mac_query_char_extents (style, c,
                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 @@ mac_load_query_font (f, fontname)
                                    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;