unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#12364: 24.2.50; wrong overhang display for gstring compositions
@ 2012-09-06  2:37 YAMAMOTO Mitsuharu
  2012-09-06  8:18 ` Eli Zaretskii
  2012-09-07  8:47 ` YAMAMOTO Mitsuharu
  0 siblings, 2 replies; 4+ messages in thread
From: YAMAMOTO Mitsuharu @ 2012-09-06  2:37 UTC (permalink / raw)
  To: 12364

Steps to Reproduce:

1. $ emacs -Q &
2. evaluate (set-fontset-font t 'arabic (font-spec :family "arial" :size 30))
3. C-u C-\ arabic RET
4. u S u
   At this moment, the two grapheme clusters look connected.
5. C-b C-p
   Now the two grapheme clusters look unconnected.

See also the "u-S-u" example in the first screenshot in
http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-09/msg00178.html .

I think at least the two occurrences of the following line in xdisp.c
are wrong.

      int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars);

The value of s->cmp seems to be NULL for the "gstring" cases.

					YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

In GNU Emacs 24.2.50.1 (x86_64-apple-darwin12.1.0, X toolkit, Xaw3d scroll bars)
 of 2012-09-06 on YAMAMOTO-no-iMac.local
Bzr revision: 109895 yamaoka@jpl.org-20120905224543-v2x5qiqin2b83lnv
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
Configured using:
 `configure '--enable-checking' '--with-jpeg=no' '--with-gif=no'
 '--with-tiff=no' 'CFLAGS=-g3''

Important settings:
  value of $LANG: ja_JP.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#12364: 24.2.50; wrong overhang display for gstring compositions
  2012-09-06  2:37 bug#12364: 24.2.50; wrong overhang display for gstring compositions YAMAMOTO Mitsuharu
@ 2012-09-06  8:18 ` Eli Zaretskii
  2012-09-07  8:47 ` YAMAMOTO Mitsuharu
  1 sibling, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2012-09-06  8:18 UTC (permalink / raw)
  To: YAMAMOTO Mitsuharu; +Cc: 12364

> Date: Thu, 06 Sep 2012 11:37:26 +0900
> From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
> 
> Steps to Reproduce:
> 
> 1. $ emacs -Q &
> 2. evaluate (set-fontset-font t 'arabic (font-spec :family "arial" :size 30))
> 3. C-u C-\ arabic RET
> 4. u S u
>    At this moment, the two grapheme clusters look connected.
> 5. C-b C-p
>    Now the two grapheme clusters look unconnected.

Not reproducible on Windows XP.

Are you using the latest libm17n-flt and libotf libraries, and the
latest fonts?

> I think at least the two occurrences of the following line in xdisp.c
> are wrong.
> 
>       int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars);
> 
> The value of s->cmp seems to be NULL for the "gstring" cases.

These two lines are not executed here, when the above recipe is used.
Maybe that's why I don't see the problem.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#12364: 24.2.50; wrong overhang display for gstring compositions
  2012-09-06  2:37 bug#12364: 24.2.50; wrong overhang display for gstring compositions YAMAMOTO Mitsuharu
  2012-09-06  8:18 ` Eli Zaretskii
@ 2012-09-07  8:47 ` YAMAMOTO Mitsuharu
  2012-09-11  4:01   ` YAMAMOTO Mitsuharu
  1 sibling, 1 reply; 4+ messages in thread
From: YAMAMOTO Mitsuharu @ 2012-09-07  8:47 UTC (permalink / raw)
  To: 12364

[-- Attachment #1: Type: text/plain, Size: 2759 bytes --]

>>>>> On Thu, 06 Sep 2012 11:37:26 +0900, YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> said:

> Steps to Reproduce:
> 1. $ emacs -Q &
> 2. evaluate (set-fontset-font t 'arabic (font-spec :family "arial" :size 30))
> 3. C-u C-\ arabic RET
> 4. u S u
>    At this moment, the two grapheme clusters look connected.
> 5. C-b C-p
>    Now the two grapheme clusters look unconnected.

> See also the "u-S-u" example in the first screenshot in
> http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-09/msg00178.html .

> I think at least the two occurrences of the following line in xdisp.c
> are wrong.

>       int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars);

> The value of s->cmp seems to be NULL for the "gstring" cases.

I tried making a fix.  The change for xterm.c is so the box cursor can
invert the left overhang of the succeeding glyph.  The attached
screenshots show the difference between with (first) and without
(second) the patch with respect to the following steps.

1. emacs -Q -D &
2. (set-frame-font "Times-32") C-j
3. C-u y
4. C-a C-SPC C-e M-o b
5. C-a C-SPC C-e M-o i
6. C-b C-b

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

=== modified file 'src/xdisp.c'
*** src/xdisp.c	2012-09-05 03:37:32 +0000
--- src/xdisp.c	2012-09-07 01:21:28 +0000
***************
*** 23050,23056 ****
      {
        int x = 0, i;
        struct glyph *glyphs = s->row->glyphs[s->area];
!       int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars);
        int end = s->row->used[s->area];
  
        for (i = first; i < end && s->right_overhang > x; ++i)
--- 23050,23057 ----
      {
        int x = 0, i;
        struct glyph *glyphs = s->row->glyphs[s->area];
!       int first = (s->first_glyph - glyphs
! 		   + (s->first_glyph->type == COMPOSITE_GLYPH ? 1 : s->nchars));
        int end = s->row->used[s->area];
  
        for (i = first; i < end && s->right_overhang > x; ++i)
***************
*** 23073,23079 ****
    int i, k, x;
    int end = s->row->used[s->area];
    struct glyph *glyphs = s->row->glyphs[s->area];
!   int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars);
  
    k = -1;
    x = 0;
--- 23074,23081 ----
    int i, k, x;
    int end = s->row->used[s->area];
    struct glyph *glyphs = s->row->glyphs[s->area];
!   int first = (s->first_glyph - glyphs
! 	       + (s->first_glyph->type == COMPOSITE_GLYPH ? 1 : s->nchars));
  
    k = -1;
    x = 0;

=== modified file 'src/xterm.c'
*** src/xterm.c	2012-09-07 01:27:44 +0000
--- src/xterm.c	2012-09-07 03:41:30 +0000
***************
*** 2975,2980 ****
--- 2975,2981 ----
  		XSetClipMask (next->display, next->gc, None);
  		next->hl = save;
  		next->num_clips = 0;
+ 		next->clip_head = s->next;
  	      }
  	}
      }


[-- Attachment #2: after.png --]
[-- Type: image/png, Size: 4442 bytes --]

[-- Attachment #3: before.png --]
[-- Type: image/png, Size: 4412 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#12364: 24.2.50; wrong overhang display for gstring compositions
  2012-09-07  8:47 ` YAMAMOTO Mitsuharu
@ 2012-09-11  4:01   ` YAMAMOTO Mitsuharu
  0 siblings, 0 replies; 4+ messages in thread
From: YAMAMOTO Mitsuharu @ 2012-09-11  4:01 UTC (permalink / raw)
  To: 12364-done

>>>>> On Fri, 07 Sep 2012 17:47:23 +0900, YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> said:

> I tried making a fix.  The change for xterm.c is so the box cursor can
> invert the left overhang of the succeeding glyph.

I've just installed the patch.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-11  4:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-06  2:37 bug#12364: 24.2.50; wrong overhang display for gstring compositions YAMAMOTO Mitsuharu
2012-09-06  8:18 ` Eli Zaretskii
2012-09-07  8:47 ` YAMAMOTO Mitsuharu
2012-09-11  4:01   ` YAMAMOTO Mitsuharu

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).