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 14:37:24 +0300 Message-ID: <831r70fc0b.fsf@gnu.org> References: <831r71h5jv.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3600"; 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 13:38:00 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 1mDmYZ-0000ht-3s for ged-emacs-devel@m.gmane-mx.org; Wed, 11 Aug 2021 13:37:59 +0200 Original-Received: from localhost ([::1]:55764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDmYY-0001Jz-25 for ged-emacs-devel@m.gmane-mx.org; Wed, 11 Aug 2021 07:37:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDmXp-0000Ra-95 for emacs-devel@gnu.org; Wed, 11 Aug 2021 07:37:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55508) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDmXo-0006Wb-U5; Wed, 11 Aug 2021 07:37:13 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2645 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 1mDmXo-0000Ri-H0; Wed, 11 Aug 2021 07:37:12 -0400 In-Reply-To: (message from Anand Tamariya on Wed, 11 Aug 2021 09:18:23 +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:272318 Archived-At: > From: Anand Tamariya > Date: Wed, 11 Aug 2021 09:18:23 +0530 > Cc: emacs-devel@gnu.org > > Does it also start RTL text at the right edge of the paper? And how > does it reorder characters for printing? > > (Sorry for asking these questions, but I'm still unable to see > anything useful on the GitLab URL you show -- when I go there, I see > only the navigation tree on the left and an empty pane on the right.) > > The code uses window positioning information for characters from Emacs and then scales the content to fit > the print width. So this needs the buffer text be displayed in some window, before it could be printed? > 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. Is this test performed on each character or only at the beginning of a visual line? And I see that if you detect RTL characters, you just reverse the text you get? That is also very simplistic and will work correctly only if the text includes only strong RTL characters, not numbers and no embedded LTR characters. Apologies if I didn't understand what the code does correctly; I only had a cursory glance on it, and there are not so many comments explaining what it does. Thanks.