From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#41005: problem with rendering Persian text in Emacs 27 Date: Thu, 04 Jun 2020 08:28:24 +0000 Message-ID: <878sh35j6f.fsf@gmail.com> References: <831rmwc9ke.fsf@gnu.org> <35A46479-A62C-42FF-995B-B295FE3408C0@gnu.org> <08A9D65F-0C9C-4EE2-B3B9-2AA25BFFAD54@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="65389"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 41005@debbugs.gnu.org, nicholasdrozd@gmail.com To: hossein valizadeh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 04 10:29:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1jglFO-000GsB-4i for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Jun 2020 10:29:10 +0200 Original-Received: from localhost ([::1]:36552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jglFM-0003d6-Pt for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Jun 2020 04:29:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jglFG-0003cv-5m for bug-gnu-emacs@gnu.org; Thu, 04 Jun 2020 04:29:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jglFF-0005RM-RL for bug-gnu-emacs@gnu.org; Thu, 04 Jun 2020 04:29:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jglFF-00020R-OV for bug-gnu-emacs@gnu.org; Thu, 04 Jun 2020 04:29:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jun 2020 08:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41005 X-GNU-PR-Package: emacs Original-Received: via spool by 41005-submit@debbugs.gnu.org id=B41005.15912593177676 (code B ref 41005); Thu, 04 Jun 2020 08:29:01 +0000 Original-Received: (at 41005) by debbugs.gnu.org; 4 Jun 2020 08:28:37 +0000 Original-Received: from localhost ([127.0.0.1]:45062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jglEr-0001zk-Gu for submit@debbugs.gnu.org; Thu, 04 Jun 2020 04:28:37 -0400 Original-Received: from mail-wm1-f45.google.com ([209.85.128.45]:55617) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jglEp-0001zU-R3 for 41005@debbugs.gnu.org; Thu, 04 Jun 2020 04:28:36 -0400 Original-Received: by mail-wm1-f45.google.com with SMTP id c71so4329794wmd.5 for <41005@debbugs.gnu.org>; Thu, 04 Jun 2020 01:28:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=xc0lMJoRhtGzvLBDyNt2d49o9/SqWU59Sl+AsiviXtA=; b=cPvFNK0vRmLDHMFkuzJ9umxZ5NFkWY/pcAteqBVACVzwuHE4JJq8yTCCMdGPMgicp0 L2WY6EOhQSdRqIRdVTxrdBtf0TjoALfHIwXfxDJ/B9K5Ynt4Lfs58EMZ9EJ7cq7sxg1L YoYsGmMOUMWGq2QtfYmj2Sw1srXcCPM9mRnVgWgvSjvg2tpqL59pSfvwCfVjLZ7kv02R GYhZWseKTV5hGCNNx6eNVNpgR9uE0ocJIs0l89SiaNXajI0IG16ws+Ty8To4TKQ+oQcg DmDS30MSODS+g5yCi64MncbR0/8iLtp3BGlEn/m4/I5xukuTlRH1xjf2utr7eS/QJXwz inPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=xc0lMJoRhtGzvLBDyNt2d49o9/SqWU59Sl+AsiviXtA=; b=KGdbW1v3kBtdJpIfc8uYS5VUjQNWeu2tfaTbm7vXriYdtsZznnmJwah4JA40XWIrta PFjLdBiNoE/zSf7B8IcNpCCcMwQQcY7Wv597Z2l/rX46IRCADqmg624Ghh+Nn4a2qjDc 54LW/TkpLAHPiYsrBZvzWELXPpIzToySqAXD9IOI125Gq9JRc3MGJWRlNUPOPK6Bc7VZ x5j/KIcRlXNY6nDe2otm/vxDnBcF98Gf8pqN5KlNln8QChQDWI1kSkwEVv5z3Yos3kkT W2bmcF77WqdWulrPql+zQjhe2vhHZoih82TCIoERTH4fnbtS0/sHoFIO9x+uyfXhfvml QQaA== X-Gm-Message-State: AOAM530ffkTEkcSchyOnTjV01AriJHCN2kSTpjxgLZH4SuPhGIPLRds6 /qL+B9g2P6FcWGIkO/O211A= X-Google-Smtp-Source: ABdhPJzGD+dOOs5RTc9ZgJxqKP9d3F3Z5/N7aap+7f38meuILRumsx3H85Db6rJm+pOUT6psFCHTAg== X-Received: by 2002:a1c:1fc2:: with SMTP id f185mr2936240wmf.4.1591259309919; Thu, 04 Jun 2020 01:28:29 -0700 (PDT) Original-Received: from chametz ([185.220.101.11]) by smtp.gmail.com with ESMTPSA id e15sm6515858wme.9.2020.06.04.01.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 01:28:29 -0700 (PDT) In-Reply-To: (hossein valizadeh's message of "Thu, 4 Jun 2020 10:57:55 +0430") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181495 Archived-At: hossein valizadeh writes: > And finally, please try this with the version on the master branch, where a few fixes were > installed lately. I can reproduce the very similar issue described (Farsi Wikipedia entry for Emacs), on current master. I believe I've figured it out, but I can also debug further if required. What happens is that font-shape-gstring is called with direction == L2R, mis-shapes the text, then caches that version in the composition gstring cache. The cache doesn't distinguish directions, and it's never cleared, so this "infects" other buffers, but only if they're opened afterwards, and only for the same words. shr appears to force bidi-display-reordering off. Removing that let binding from shr-insert-document avoids the problem. We should consider adding direction to our gstrings, on master. While we're there, let's also add script, language, and harfbuzz features to the gstrings so we know we've captured the precise harfbuzz parameters?