From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Basic WYSIWYG printing in GNU Emacs (Arabic & Hebrew) Date: Wed, 11 Aug 2021 19:57:00 +0300 Message-ID: <83k0krex7n.fsf@gnu.org> References: <831r71h5jv.fsf@gnu.org> <831r70fc0b.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19702"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Anand Tamariya Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 11 18:58:11 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mDrYR-0004sM-Ke for ged-emacs-devel@m.gmane-mx.org; Wed, 11 Aug 2021 18:58:11 +0200 Original-Received: from localhost ([::1]:37522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDrYQ-0004fs-1h for ged-emacs-devel@m.gmane-mx.org; Wed, 11 Aug 2021 12:58:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDrX3-0003VI-Tf for emacs-devel@gnu.org; Wed, 11 Aug 2021 12:56:45 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38166) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDrX3-0001tZ-NT; Wed, 11 Aug 2021 12:56:45 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2619 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDrX3-0003wO-EO; Wed, 11 Aug 2021 12:56:45 -0400 In-Reply-To: (message from Anand Tamariya on Wed, 11 Aug 2021 21:29:53 +0530) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272329 Archived-At: > From: Anand Tamariya > Date: Wed, 11 Aug 2021 21:29:53 +0530 > Cc: emacs-devel@gnu.org > > > It uses following API to determine BIDI classification and processes accordingly: > > (get-char-code-property (char-after from) 'bidi-class) > > Hmm... not sure this is enough, except in the simplest cases. The > bidi-class of a character is just its basic attribute; application of > the full Unicode Bidirectional Algorithm can and does change the > effective attributes of some characters, before they are displayed. > > Do you have some sample text for this use case? I can run a quick test. You could try TUTORIAL.he, for example. > Is this test performed on each character or only at the beginning of a > visual line? > > This happens at every point where the font changes. So if the entire buffer uses just a single font, like TUTORIAL.he does, you do the test only once, at the first character of the buffer text? But that could produce incorrect results, because the text further into the buffer could have both RTL and LTR paragraphs intermixed, and the correct display will show each of these at their correct base direction. For example, most of the paragraphs in TUTORIAL.he have right-to-left base direction, but the last paragraph, with the Local Variables, is left-to-right, so its display starts at the left edge of the window.