all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alp Aker <aker@pitt.edu>
To: 8651@debbugs.gnu.org
Subject: bug#8651: `raise' properties on NextStep
Date: Tue, 10 May 2011 18:14:31 +0000 (UTC)	[thread overview]
Message-ID: <loom.20110510T201126-921@post.gmane.org> (raw)

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.






             reply	other threads:[~2011-05-10 18:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10 18:14 Alp Aker [this message]
2011-05-11 13:08 ` bug#8651: `raise' properties on NextStep Eli Zaretskii
2011-05-11 21:55   ` Alp Aker
2011-05-11 14:44 ` Stefan Monnier
2011-06-22 18:21 ` Alp Aker
2011-06-25 13:03   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20110510T201126-921@post.gmane.org \
    --to=aker@pitt.edu \
    --cc=8651@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.