From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Khaled Hosny Newsgroups: gmane.emacs.bugs Subject: bug#33729: 27.0.50; Partial glyphs not rendered for Gujarati with Harfbuzz enabled (renders fine using m17n) Date: Mon, 24 Dec 2018 19:37:23 +0200 Message-ID: <20181224173723.GH6568@macbook.localdomain> References: <20181222151509.GC2244@macbook.localdomain> <83h8f5a7po.fsf@gnu.org> <20181222154945.GE2244@macbook.localdomain> <83bm5d9wsc.fsf@gnu.org> <20181222205948.GF2244@macbook.localdomain> <838t0gapcj.fsf@gnu.org> <20181223135109.GA6568@macbook.localdomain> <83va3k8c79.fsf@gnu.org> <20181224020847.GC6568@macbook.localdomain> <83lg4e9a7q.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1545672966 14144 195.159.176.226 (24 Dec 2018 17:36:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Dec 2018 17:36:06 +0000 (UTC) User-Agent: Mutt/1.11.1 (2018-12-01) Cc: behdad@behdad.org, 33729@debbugs.gnu.org, far.nasiri.m@gmail.com, kaushal.modi@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 24 18:36:01 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gbU93-0003Wd-9Z for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Dec 2018 18:36:01 +0100 Original-Received: from localhost ([127.0.0.1]:38317 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbUBA-00022X-04 for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Dec 2018 12:38:12 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:47948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbUB4-00022R-4o for bug-gnu-emacs@gnu.org; Mon, 24 Dec 2018 12:38:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gbUAz-0007hP-WA for bug-gnu-emacs@gnu.org; Mon, 24 Dec 2018 12:38:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59576) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gbUAz-0007hI-S6 for bug-gnu-emacs@gnu.org; Mon, 24 Dec 2018 12:38:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gbUAz-0001Od-OX for bug-gnu-emacs@gnu.org; Mon, 24 Dec 2018 12:38:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Khaled Hosny Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Dec 2018 17:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33729 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33729-submit@debbugs.gnu.org id=B33729.15456730555332 (code B ref 33729); Mon, 24 Dec 2018 17:38:01 +0000 Original-Received: (at 33729) by debbugs.gnu.org; 24 Dec 2018 17:37:35 +0000 Original-Received: from localhost ([127.0.0.1]:35601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gbUAY-0001Nw-Ri for submit@debbugs.gnu.org; Mon, 24 Dec 2018 12:37:35 -0500 Original-Received: from mail-wr1-f50.google.com ([209.85.221.50]:34310) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gbUAX-0001Ni-A7 for 33729@debbugs.gnu.org; Mon, 24 Dec 2018 12:37:33 -0500 Original-Received: by mail-wr1-f50.google.com with SMTP id j2so12126499wrw.1 for <33729@debbugs.gnu.org>; Mon, 24 Dec 2018 09:37:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Gana4c+e6HGNisJXyoKZtAkhPEAXnBq/NCm0M7y9dF0=; b=DyUZ/k5C5UThWt0BWaHJ+0/mY5j7jqe9wbRtUdKErJZALC9I+ZwhimHzdnoVIRezm8 Us8WjhZDEX957vZ/KhzC23CD5hjAgQAAP/9PydvZizNzkrtQc878bGRXWLWxOKIx2wc6 L0yeJ9CyDJGDeWjuZPubf5MpmIPgxqYN7CtsYkokFcA8Ql1L4mgnP+LB6Uf/Ykj0RB7b BtFQkJe3IcwjlFT67uVOWHvEhgtR6S5aSJ89Z6Oo680kKd+co0l9icdQHbA5W3EPz//6 pi6pZdU9E+N7t7OPNWOakHC5+XzoDs4xn57uDVilQvtOtDqVDJVFgubv+ukY0on+uTL1 PWcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Gana4c+e6HGNisJXyoKZtAkhPEAXnBq/NCm0M7y9dF0=; b=Okk+e3icq7VEarMkse7U6cGG3+MMRuHaZv8cB9dArP6hjVWks9+15bb9kgUkXRLO7p VYmZf3z+TUwnNOQQ2TstkuuMXNeT8Nyhv92zKw54+ZVgqDydihhpIwb9vUODAKtiQoZZ FInHZsiHSZERr4H5IhQuw48iGHQLvxPkaXDgq+N4Jto8kS7nGVy8qEcz2MYoAyBQsraH u7O8b5sqX5vuXeMcf+KwIjUrvDxAvd9oXUmmwRmTVlztGnFH6STGdS+fwHl4wC6O+A26 q8xlJ8kKQNn5vH3NkuhiSdTsxFBbUKsVgjkOlRfMa0RbSyI1vA0nx5ZTJz7BKuq2Hq55 rJNw== X-Gm-Message-State: AJcUukdXPA3BB1x3l+KiaogL66V3DG4D4ZluVwB6tOD40BYT4CQlvGgV rs+mvyU8vuttJ1R0OUejNfU= X-Google-Smtp-Source: ALg8bN5WEdfwyLaBA5FUy4nvqKraDwg73YonM4xaKazRA5CFuWmPI4xAAKTf6j0F8zH9y/Etc12IkQ== X-Received: by 2002:a5d:694d:: with SMTP id r13mr12059510wrw.323.1545673047517; Mon, 24 Dec 2018 09:37:27 -0800 (PST) Original-Received: from macbook.localdomain ([41.237.113.27]) by smtp.gmail.com with ESMTPSA id t63sm16609962wmt.8.2018.12.24.09.37.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Dec 2018 09:37:26 -0800 (PST) Content-Disposition: inline In-Reply-To: <83lg4e9a7q.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:153822 Archived-At: On Mon, Dec 24, 2018 at 06:10:49PM +0200, Eli Zaretskii wrote: > > Date: Mon, 24 Dec 2018 04:08:47 +0200 > > From: Khaled Hosny > > Cc: rgm@gnu.org, far.nasiri.m@gmail.com, behdad@behdad.org, > > 33729@debbugs.gnu.org, kaushal.modi@gmail.com > > > > I think we are almost good now. There is only one serious FIXME left: > > > > /* FIXME: guess_segment_properties is BAD BAD BAD. > > * we need to get these properties with the LGSTRING. */ > > #if 1 > > hb_buffer_guess_segment_properties (hb_buffer); > > #else > > hb_buffer_set_direction (hb_buffer, XXX); > > hb_buffer_set_script (hb_buffer, XXX); > > hb_buffer_set_language (hb_buffer, XXX); > > #endif > > > > We need to know, for a given lgstring we are shaping: > > * Its direction (from applying bidi algorithm). Each lgstring we are > > shaping must be of a single direction. > > Communicating this to ftfont_shape_by_hb will need changes in a couple > of interfaces (the existing shaping engines didn't need this > information). I will work on this soon. Great. > > * Its script, possibly after applying something like: > > http://unicode.org/reports/tr24/#Common > > Per previous discussions, we decided to use the Harfbuzz built-in > methods for determining the script, since Emacs doesn't have this > information, and adding it will just do the same as Harfbuzz does, > i.e. find the first character whose script is not Common etc., using > the UCD database. I think it was you who suggested to use the > Harfbuzz built-ins in this case. The built-in HarfBuzz code is for getting the script for a given character, but resolving characters with Common script is left to the client. Suppose you have this string (upper case for RTL) ABC 123 DEF, what HarfBuzz sees during shaping is three separate chunks of text ABC, 123, DEF. The 123 part is all Common script characters and thus hb_buffer_guess_segment_properties won’t be able to guess anything (and based on the font and the script, this can cause rendering differences). Emacs will have to resolve the script of Common characters before applying bidi algorithm and pass that down to HarfBuzz. > > * Its language, is Emacs allows setting text language (my understand is > > that it doesn’t). Some languages really need this for applying > > language-specfic features (Urdu digits, Serbian alternate glyphs, etc.). > > We don't currently have a language property for chunks of text, we > only have the current global language setting determined from the > locale (and there's a command to change that for Emacs, should the > user want it). This is not really appropriate for multilingual > buffers, but we will have to use that for now, and hope that in the > future, infrastructure will be added to allow more flexible > determination of the language of each run of text. (I see that > Harfbuzz already looks a the locale for its default language, but > since Emacs allows user control of this, however unlikely, I think > it's best to use the value Emacs uses.) I will work on this as well. Yes, better pass that from Emacs to HarfBuzz. Regards, Khaled