GNU bug report logs - #8651
`raise' properties on NextStep

Previous Next

Packages: ns, emacs;

Reported by: Alp Aker <aker <at> pitt.edu>

Date: Wed, 11 May 2011 07:51:01 UTC

Severity: important

Tags: patch

Merged with 7831, 8913

Found in version 23.2

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8651 in the body.
You can then email your comments to 8651 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8651; Package emacs. (Wed, 11 May 2011 07:51:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alp Aker <aker <at> pitt.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 11 May 2011 07:51:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alp Aker <aker <at> pitt.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: `raise' properties on NextStep
Date: Tue, 10 May 2011 18:14:31 +0000 (UTC)
Yesterday it came up on a thread on the devel list that on
NextStep the `raise' property increases line height but does
nothing more; it doesn't alter the vertical positioning of
characters.  The question then arose whether this was a bug on
NextStep, since the implementation of display properties isn't
OS-specific.  Some hasty investigation appears to show that the
problem is actually in the implementation of the glyph-drawing
routines for NextStep.

Make the following change to the trunk:

=== modified file 'src/nsfont.m'
--- src/nsfont.m	2011-04-16 03:14:08 +0000
+++ src/nsfont.m	2011-05-10 17:13:25 +0000
@@ -1273,6 +1273,8 @@
     else
       [col set];
 
+    r.origin.y = s->ybase;
+
     CGContextSetTextPosition (gcontext, r.origin.x, r.origin.y);
     CGContextShowGlyphsWithAdvances (gcontext, s->char2b + s->cmp_from,
                                     advances, len);

and build with `./configure --with-ns'.  The result is an
executable in which `raise' properties have the documented
behavior.

The above change is naive, and will break other things (such as
underline positioning), but it serves as a proof of concept that
the issue is on Emacs's side.  

As far as I can see, the problem is this (please correct me if
I've misunderstood the display routine, which is
likely).  Changes in vertical character position that result from
display properties are processed in xdisp.c, and those changes
are reflected in the value of the ybase field.  But many of the
gylph-drawing functions in nsterm.m and nsfont.m only check the y field
to determine the vertical position of a glyph; they don't use ybase 
at all.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8651; Package emacs. (Wed, 11 May 2011 13:09:02 GMT) Full text and rfc822 format available.

Message #8 received at 8651 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alp Aker <aker <at> pitt.edu>
Cc: 8651 <at> debbugs.gnu.org
Subject: Re: bug#8651: `raise' properties on NextStep
Date: Wed, 11 May 2011 09:08:39 -0400
> From: Alp Aker <aker <at> pitt.edu>
> Date: Tue, 10 May 2011 18:14:31 +0000 (UTC)
> 
> Yesterday it came up on a thread on the devel list that on
> NextStep the `raise' property increases line height but does
> nothing more; it doesn't alter the vertical positioning of
> characters.  The question then arose whether this was a bug on
> NextStep, since the implementation of display properties isn't
> OS-specific.

This is a misunderstanding.  I never said that the problem is outside
Emacs.  I said that it's probably in the NS-specific parts of Emacs.

Most of the work of handling the `raise' property is in
device-independent code in xdisp.c.  However, the terminal-specific
code should obey the computed metrics of the glyphs when it draws the
glyphs on the screen.  It looks like NS-specific display code doesn't,
while both xterm.c and w32term.c do, see
x_draw_glyph_string_foreground.

> The above change is naive, and will break other things (such as
> underline positioning), but it serves as a proof of concept that
> the issue is on Emacs's side.  

Of course, it's on the Emacs side!  Where else could it possibly be?
It would be silly to claim that NextStep as a system cannot draw
characters at pixel resolution.

> many of the
> gylph-drawing functions in nsterm.m and nsfont.m only check the y field
> to determine the vertical position of a glyph; they don't use ybase 
> at all.

Which constitutes an NS-specific bug in Emacs.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8651; Package emacs. (Wed, 11 May 2011 14:45:02 GMT) Full text and rfc822 format available.

Message #11 received at 8651 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alp Aker <aker <at> pitt.edu>
Cc: 8651 <at> debbugs.gnu.org
Subject: Re: bug#8651: `raise' properties on NextStep
Date: Wed, 11 May 2011 11:44:18 -0300
> As far as I can see, the problem is this (please correct me if
> I've misunderstood the display routine, which is
> likely).  Changes in vertical character position that result from
> display properties are processed in xdisp.c, and those changes
> are reflected in the value of the ybase field.  But many of the
> gylph-drawing functions in nsterm.m and nsfont.m only check the y field
> to determine the vertical position of a glyph; they don't use ybase 
> at all.

Thanks for the bug report and diagnostic, which sounds just right.
Hopefully someone familiar with the NS code will find the time to write
an actual patch for it.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8651; Package emacs,ns. (Wed, 11 May 2011 21:56:02 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alp Aker <aker <at> pitt.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#8651: `raise' properties on NextStep
Date: Wed, 11 May 2011 21:55:12 +0000 (UTC)
> This is a misunderstanding.  I never said that the problem is outside
> Emacs.  I said that it's probably in the NS-specific parts of Emacs.

Well, you did say "Maybe it's a bug in NextStep, then" :)  

But sorry to have misinterpreted you.  In any case, I just wanted to
make sure the bug was in the database.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8651; Package emacs,ns. (Wed, 22 Jun 2011 18:22:02 GMT) Full text and rfc822 format available.

Message #17 received at 8651 <at> debbugs.gnu.org (full text, mbox):

From: Alp Aker <aker <at> pitt.edu>
To: 8651 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, eliz <at> gnu.org
Subject: Re: bug#8651: `raise' properties on NextStep
Date: Wed, 22 Jun 2011 14:21:24 -0400 (EDT)
Stefan Monnier writes:

> Thanks for the bug report and diagnostic, which sounds just right. 
> Hopefully someone familiar with the NS code will find the time to write 
> an actual patch for it.

I studied the NS code some and wrote up a patch.  I posted it in the 
thread for bug 8913, as that concerns the same issue and was opened 
yesterday.  (I'm noting the connection here to make sure this bug also 
gets closed if the patch is accepted.)





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8651; Package emacs,ns. (Sat, 25 Jun 2011 13:04:02 GMT) Full text and rfc822 format available.

Message #20 received at 8651 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alp Aker <aker <at> pitt.edu>
Cc: 8651 <at> debbugs.gnu.org, Adrian Robert <Adrian.B.Robert <at> gmail.com>,
	eliz <at> gnu.org
Subject: Re: bug#8651: `raise' properties on NextStep
Date: Sat, 25 Jun 2011 09:03:18 -0400
forcemerge 8651 8913
thanks

>> Thanks for the bug report and diagnostic, which sounds just
>> right. Hopefully someone familiar with the NS code will find the time to
>> write an actual patch for it.
> I studied the NS code some and wrote up a patch.  I posted it in the thread
> for bug 8913, as that concerns the same issue and was opened yesterday.
> (I'm noting the connection here to make sure this bug also gets closed if
> the patch is accepted.)

Thank you very much, could some NS guy confirm it's right and install it?


        Stefan




Forcibly Merged 7831 8651 8913. Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> debbugs.gnu.org. (Sat, 25 Jun 2011 13:04:03 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> debbugs.gnu.org. (Mon, 04 Jul 2011 18:39:02 GMT) Full text and rfc822 format available.

Severity set to 'important' from 'normal' Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> debbugs.gnu.org. (Sat, 09 Jul 2011 02:53:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 8913 <at> debbugs.gnu.org and David Aspinall <David.Aspinall <at> ed.ac.uk> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Thu, 28 Jul 2011 18:51:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 26 Aug 2011 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 298 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.