From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Anand Tamariya Newsgroups: gmane.emacs.devel Subject: Re: Basic WYSIWYG printing in GNU Emacs (Arabic & Hebrew) Date: Wed, 11 Aug 2021 21:29:53 +0530 Message-ID: References: <831r71h5jv.fsf@gnu.org> <831r70fc0b.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000035bf5c05c94ab60f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15674"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 11 18:02:33 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 1mDqgY-0003nN-Tj for ged-emacs-devel@m.gmane-mx.org; Wed, 11 Aug 2021 18:02:30 +0200 Original-Received: from localhost ([::1]:41354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDqgX-0000I8-7Y for ged-emacs-devel@m.gmane-mx.org; Wed, 11 Aug 2021 12:02:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDqeI-0004ZP-Ku for emacs-devel@gnu.org; Wed, 11 Aug 2021 12:00:10 -0400 Original-Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]:36742) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDqeF-0004Oy-95; Wed, 11 Aug 2021 12:00:10 -0400 Original-Received: by mail-io1-xd2c.google.com with SMTP id f11so4299231ioj.3; Wed, 11 Aug 2021 09:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ycVhpJAPckmW1QKR60a5fCr/o0YbqjQzxmdyh9NeYD8=; b=BKDvSbHNH9CEr2VkNVhp0XIUdLKMzfnDoJpuR3wjyiQBoIUZYlCcYndFuvCXkWx3rN 442tXc1GQWfmDMzateLI1cgDLqTvNqq0q3Nc3UY1xYNy51OvrMWgu9kQBYttYvIesu8T mdZNiDW3sdGxd8Jp1+2y54k0GsI02mYhjTTpZ7fv5lJaLTmA683sxcQlygeEVIyld9lf fFTrmBijj03R5CQUc86W0+m7YfQE1OC3C2AHKHbqhYhE8nEIO0GR8fn20xWYYgTxzd7G NYrHYUIRHpFT6vO4j9paGEH2YBWFycIl/Fd4zC7ko4tmWEyGopdGoR4F5FQrs1ntsqNQ U/iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ycVhpJAPckmW1QKR60a5fCr/o0YbqjQzxmdyh9NeYD8=; b=g2H3k99QunEhLitK5T3DEFnHKyyb2I1PkFcgm30bFd0w/KilZCb+HOclh1y5X9WP+t btvpEe8p43M4jgLWzgyQgNMpJsJk2U9ssHwsek9MK1L/+lsAQOVPFHcB/8DSknv8k2e1 tmr25kZoviNeajXuJRCwGleHUdMmtjr3quP4/lRbIC9QiujrmD9cFudh5lq4tWNZgYnQ DcAGfLpiJSCvs7TjMa+bUAxUkPnj4ASGYvrCY82wJ33cvxiRcb78L4pqnrAGGe91l5rt LIxxgpqak2iwNnQHypxHRBCFh1kV2kePprHtXJYIjbb1wCpxzLs7NHzIYJshwVoFV4wD mtGw== X-Gm-Message-State: AOAM532WuihD4i02/dYiyqBc8MBlnxNImwMDEYl0eTIcVZViecqhA2bL INBeSIXlcF1Vih6MlaA0O/6lgZOPPkDclRxmVb/X46xvdRg= X-Google-Smtp-Source: ABdhPJxvNb7xSk8pRw/ymPH3D2uC5FwZ/UGjwKznQSimptl53+3vFbq1Kkft9YzUxnmLJCzdTkokG/L5PB1Fm12+GKw= X-Received: by 2002:a6b:ea19:: with SMTP id m25mr331196ioc.182.1628697605290; Wed, 11 Aug 2021 09:00:05 -0700 (PDT) In-Reply-To: <831r70fc0b.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::d2c; envelope-from=atamariya@gmail.com; helo=mail-io1-xd2c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:272324 Archived-At: --00000000000035bf5c05c94ab60f Content-Type: text/plain; charset="UTF-8" > So this needs the buffer text be displayed in some window, before it > could be printed? > Yes. Plain text file would not have any font/ display information otherwise. > 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. 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. 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. > No worries. I'm happy to answer any queries. --00000000000035bf5c05c94ab60f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

So this needs the buffer text be displayed in some window, before it
could be printed?
Yes. Plain text file would not have = any font/ display information otherwise.

> It uses following API to determine BIDI classification and processes a= ccordingly:
> (get-char-code-property (char-after from) 'bidi-class)

Hmm... not sure this is enough, except in the simplest cases.=C2=A0 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 q= uick test.

Is this test performed on each character or only at the beginning of a
visual line?
This happens at every point where the fon= t changes.

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.
No worries. I'm happy to = answer any queries.
=C2=A0
--00000000000035bf5c05c94ab60f--