emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105348: Fix for raise display proper


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105348: Fix for raise display property on NS (Bug#8913).
Date: Thu, 28 Jul 2011 14:50:05 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105348
author: Alp Aker <address@hidden>
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Thu 2011-07-28 14:50:05 -0400
message:
  Fix for raise display property on NS (Bug#8913).
  
  * src/nsfont.m (nsfont_open): Remove assignment to voffset and
  unnecessary vars hshink, expand, hd, full_height, min_height.
  (nsfont_draw): Use s->ybase as baseline for glyph drawing.
  
  * src/nsterm.h (nsfont_info): Remove voffset field.
modified:
  src/ChangeLog
  src/nsfont.m
  src/nsterm.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-07-28 18:41:21 +0000
+++ b/src/ChangeLog     2011-07-28 18:50:05 +0000
@@ -12,6 +12,12 @@
        * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
        or scroll bar (Bug#8470).
 
+       * nsfont.m (nsfont_open): Remove assignment to voffset and
+       unnecessary vars hshink, expand, hd, full_height, min_height.
+       (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
+
+       * nsterm.h (nsfont_info): Remove voffset field.
+
 2011-07-28  Alp Aker  <address@hidden>
 
        Implement strike-through and overline on NextStep (Bug#8863).

=== modified file 'src/nsfont.m'
--- a/src/nsfont.m      2011-07-28 18:26:29 +0000
+++ b/src/nsfont.m      2011-07-28 18:50:05 +0000
@@ -804,8 +804,6 @@
   font->props[FONT_FILE_INDEX] = Qnil;
 
   {
-    double expand, hshrink;
-    float full_height, min_height, hd;
     const char *fontName = [[nsfont fontName] UTF8String];
     int len = strlen (fontName);
 
@@ -837,26 +835,16 @@
       [sfont maximumAdvancement].width : ns_char_width (sfont, '0');
 
     brect =  [sfont boundingRectForFont];
-    full_height = brect.size.height;
-    min_height = [sfont ascender] - adjusted_descender;
-    hd = full_height - min_height;
-
-    /* standard height, similar to Carbon. Emacs.app: was 0.5 by default. */
-    expand = 0.0;
-    hshrink = 1.0;
 
     font_info->underpos = [sfont underlinePosition];
     font_info->underwidth = [sfont underlineThickness];
     font_info->size = font->pixel_size;
-    font_info->voffset = lrint (hshrink * [sfont ascender] + expand * hd / 2);
 
     /* max bounds */
-    font_info->max_bounds.ascent =
-      lrint (hshrink * [sfont ascender] + expand * hd/2);
+    font_info->max_bounds.ascent = lrint ([sfont ascender]);
     /* Descender is usually negative.  Use floor to avoid
        clipping descenders. */
-    font_info->max_bounds.descent =
-      -lrint (floor(hshrink* adjusted_descender - expand*hd/2));
+    font_info->max_bounds.descent = -lrint (floor(adjusted_descender));
     font_info->height =
       font_info->max_bounds.ascent + font_info->max_bounds.descent;
     font_info->max_bounds.width = lrint (font_info->width);
@@ -1165,7 +1153,7 @@
 
 
   /* set up for character rendering */
-  r.origin.y += font->voffset + (s->height - font->height)/2;
+  r.origin.y = s->ybase;
 
   col = (NS_FACE_FOREGROUND (face) != 0
          ? ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f)

=== modified file 'src/nsterm.h'
--- a/src/nsterm.h      2011-07-28 18:26:29 +0000
+++ b/src/nsterm.h      2011-07-28 18:50:05 +0000
@@ -467,7 +467,6 @@
 #endif
   char bold, ital;  /* convenience flags */
   char synthItal;
-  float voffset;  /* mean of ascender/descender offsets */
   XCharStruct max_bounds;
   /* we compute glyph codes and metrics on-demand in blocks of 256 indexed
      by hibyte, lobyte */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]