From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: gerd.moellmann@t-online.de (Gerd Moellmann) Newsgroups: gmane.emacs.devel Subject: Re: variable line spacing Date: 10 Mar 2002 15:54:20 +0100 Sender: emacs-devel-admin@gnu.org Message-ID: <864rjo5v8j.fsf@gerd.dnsq.org> References: <20020310.103114.71101308.wl@gnu.org> Reply-To: gerd@gnu.org NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1015772248 7599 80.91.224.249 (10 Mar 2002 14:57:28 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 10 Mar 2002 14:57:28 +0000 (UTC) Cc: emacs-devel@gnu.org Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16k4lL-0001yS-00 for ; Sun, 10 Mar 2002 15:57:27 +0100 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16k4me-0008J3-00 for ; Sun, 10 Mar 2002 15:58:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16k4l7-0006SB-00; Sun, 10 Mar 2002 09:57:13 -0500 Original-Received: from mailout03.sul.t-online.com ([194.25.134.81]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16k4kf-0006Re-00; Sun, 10 Mar 2002 09:56:45 -0500 Original-Received: from fwd00.sul.t-online.de by mailout03.sul.t-online.com with smtp id 16k4iR-0000LL-08; Sun, 10 Mar 2002 15:54:27 +0100 Original-Received: from gerd.dnsq.org (520015515780-0001@[80.130.106.150]) by fwd00.sul.t-online.com with esmtp id 16k4iM-1KOLYGC; Sun, 10 Mar 2002 15:54:22 +0100 Original-Received: (from gerd@localhost) by gerd.dnsq.org (8.11.6/8.11.6) id g2AEsKd00706; Sun, 10 Mar 2002 15:54:20 +0100 (CET) (envelope-from gerd@gnu.org) X-Authentication-Warning: gerd.dnsq.org: gerd set sender to gerd@gnu.org using -f Original-To: Werner LEMBERG In-Reply-To: <20020310.103114.71101308.wl@gnu.org> Original-Lines: 65 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 X-Sender: 520015515780-0001@t-dialin.net Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:1839 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:1839 Werner LEMBERG writes: > Currently, it automatically increases the line spacing by one > pixel above and below for such lines. Doesn't this mix up two functionalities? It might be cleaner to separate this into two issues: no overlapping lines, and additional space between lines. > Index: src/buffer.c > =================================================================== > RCS file: /cvsroot/emacs/emacs/src/buffer.c,v > retrieving revision 1.380 > diff -u -r1.380 buffer.c > --- src/buffer.c 4 Mar 2002 23:20:06 -0000 1.380 > +++ src/buffer.c 7 Mar 2002 05:39:32 -0000 [...] > +static void > +x_set_line_spacing_no_overlap (f, arg, oldval) > + struct frame *f; > + Lisp_Object arg, oldval; > +{ > + f->line_spacing_no_overlap_p = !EQ (Qnil, arg); > } (Using NILP is preferred to EQ (Qnil, ...).) > Index: src/xterm.c > =================================================================== > RCS file: /cvsroot/emacs/emacs/src/xterm.c,v > retrieving revision 1.710 > diff -u -r1.710 xterm.c > --- src/xterm.c 4 Mar 2002 23:40:59 -0000 1.710 > +++ src/xterm.c 7 Mar 2002 05:42:29 -0000 > @@ -2323,8 +2323,9 @@ > xassert (it->ascent >= 0 && it->descent >= 0); > if (it->area == TEXT_AREA) > it->current_x += it->pixel_width; > - > - it->descent += it->extra_line_spacing; > + > + it->ascent += it->extra_line_spacing / 2; > + it->descent += it->extra_line_spacing - it->extra_line_spacing / 2; > > it->max_ascent = max (it->max_ascent, it->ascent); > it->max_descent = max (it->max_descent, it->descent); Hm, now that I see the code, I think it is more correct to do the line height changes exclusively here, also for the non-overlapping case. The reason for this is that some computations over text (the move_* functions in xdisp.c) need to know line heights, but there are no glyph rows, only the iterator. That's also the reason why I did the extra_line_spacing stuff here. Sorry for setting you on the wrong track; I'm apparently already swapping out the very basics of what I coded. If you compute IT's ascent, descent, max_ascent, and max_descent from the physical ascent and descent in x_produce_glyhs, this prevents overlapping because these values are used for the height and ascent of glyph rows. And the code in compute_line_metrics increasing the first row's height doesn't run then, because there is no overlap. There should also be no need to do anything special in other functions in xdisp.c or xterm.c, AFAIR. _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel