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: Fri, 05 Jun 2020 08:41:19 +0000 Message-ID: <87eeqt3nww.fsf@gmail.com> References: <831rmwc9ke.fsf@gnu.org> <35A46479-A62C-42FF-995B-B295FE3408C0@gnu.org> <08A9D65F-0C9C-4EE2-B3B9-2AA25BFFAD54@gnu.org> <878sh35j6f.fsf@gmail.com> <83y2p3as6c.fsf@gnu.org> <87pnae4nhx.fsf@gmail.com> <83ftbaaql5.fsf@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="113342"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: valizadeh.ho@gmail.com, 41005@debbugs.gnu.org, nicholasdrozd@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 05 10:42:12 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 1jh7vY-000TMK-NX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jun 2020 10:42:12 +0200 Original-Received: from localhost ([::1]:50898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jh7vX-0001Zr-Mm for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jun 2020 04:42:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jh7vO-0001Yk-UM for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 04:42:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36732) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jh7vO-0001kX-LJ for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 04:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jh7vO-0002uO-Hj for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 04:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Jun 2020 08:42:02 +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.159134649211144 (code B ref 41005); Fri, 05 Jun 2020 08:42:02 +0000 Original-Received: (at 41005) by debbugs.gnu.org; 5 Jun 2020 08:41:32 +0000 Original-Received: from localhost ([127.0.0.1]:48278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jh7ut-0002tf-Pc for submit@debbugs.gnu.org; Fri, 05 Jun 2020 04:41:32 -0400 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:34845) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jh7ur-0002tR-PZ for 41005@debbugs.gnu.org; Fri, 05 Jun 2020 04:41:30 -0400 Original-Received: by mail-wr1-f52.google.com with SMTP id x14so8862677wrp.2 for <41005@debbugs.gnu.org>; Fri, 05 Jun 2020 01:41:29 -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=+wzq0nc6IwQIi/KPE8S4k7GfAeYdziF1j/63pQ5S0rg=; b=brZ1S9yxoY3Cbuz1wjgHCFBhnmIVw/mJP2NXomBHvxS7UvSqqs21Lex9F+9deNAoIj AwAM+ljrMj6whWg2iTX89iRqIS142MEtHP6vp+soMmpJZfs4q8VZBK54OC1loSeIyS1H 3HogJDBC6oGHcgj9gy3/kg6QCUclpfIsY6Trrgetrxp+nrC0kM2q7upjJsfFfd9FpNVb ukS2E2TnNUOy8izhAlPWAiuMUmqoD5hQHIeUa/7Ifvnz9kPwq10CjzZkuVWnlSXiZOAl kOfFL5o6xjoQ7l4Hl97l6ef9+6hRQIvyWx36/gXD9zRNLr1JX63LtOdGGeqMXHTN3ujl J5Gw== 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=+wzq0nc6IwQIi/KPE8S4k7GfAeYdziF1j/63pQ5S0rg=; b=D9aj34dslj4k1sFfmwFHOwEa7hJJ2E6QNyMuRm+kk3LsyAgisa6DDGQEbPcVUQxmUu OXXglRHFaZj3l6S6YbvGthgg2t5QPaWNJiRWqBKRZkzT5rvpa8GTFNpaHvHIQF+xp20K TTjqG31fzXKKEpd9yFYc6Hc4AGkHtQVjoE+UaJG9UhAKNs6CZ3Kw6uXTb+ZxAamwc6Ji 7B/Rv0zWZYj0AJs1JIVPlUgt2dcb9K7GxFiHtZzl/L1o8FxoNWCQZew2hsT5YAvnr5yt QRgY9TJdyrNoULulbxJO+SKW+WFIKm3dH1MQ0s4SQz1BgkfehlxJJejQk2QpxrnmAJny LbTw== X-Gm-Message-State: AOAM531NmktEa+OU3TTjZk6oK9JO3S+q3AOSD4IQxKCpx/3qs2bB3dmz iCGn6nw55Fkvyzp9PuTFHj0= X-Google-Smtp-Source: ABdhPJxOcODywV4v4HsGu2MAJPAsDtKdwM2+Im9qjq9Ixas5PBXiom/ueyhofP1+4KkvB1eY/uUshw== X-Received: by 2002:a5d:554b:: with SMTP id g11mr8511641wrw.260.1591346483856; Fri, 05 Jun 2020 01:41:23 -0700 (PDT) Original-Received: from chametz ([185.220.101.206]) by smtp.gmail.com with ESMTPSA id s5sm10625513wme.37.2020.06.05.01.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2020 01:41:23 -0700 (PDT) In-Reply-To: <83ftbaaql5.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 05 Jun 2020 11:01:42 +0300") 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:181542 Archived-At: Eli Zaretskii writes: >> From: Pip Cet >> Cc: valizadeh.ho@gmail.com, 41005@debbugs.gnu.org, nicholasdrozd@gmail.com >> Date: Thu, 04 Jun 2020 19:52:42 +0000 >> >> > As for script and language, for now adding them would just waste >> > memory, since we don't yet have any meaningful support for >> > buffer-local, let-alone paragraph-local, scripts and languages. When >> > we added HarfBuzz support, I considered adding some functionality to >> > determine language and/or script from the codepoints, but decided that >> > it made little sense, since HarfBuzz already does exactly that in >> > hb_buffer_guess_segment_properties. So I think we should add to the >> > FIXME in hbfont.c the fact that when we do support those internally in >> > Emacs, we should add these attributes to cached gstrings, but not yet >> > actually add them for now. >> >> We're going to have to change the lgstring structure, though, right? > > I think so. We should probably add one more element to the vector in > LGSTRING_HEADER, because the header is the hash key of the composition > cache. Do we have to maintain compatibility? If so, I suggest we change [FONT-OBJECT CHAR ...] to [FONT-OBJECT [CHAR ...] DIRECTION], and use ARRAYP (AREF (..., 2)) to decide whether the new format is in effect. I actually thought about suggesting the format be [FONT-OBJECT STRING DIRECTION], but that would make debugging harder when pretty-printing the string in a failed composition re-attempts that composition. But of course it would be easier not to maintain compatibility, and then we could order the elements any way we choose. >> Could we maybe get away with just doing so once? My suggestion would be >> to add a single field to gstrings which would currently be L2R or R2L >> but might become an alist or something when we get around to adding >> those features? > > We could add an element that would currently be a symbol or an > integer, but could later become a vector of several elements. Is that > what you had in mind? Yes, a vector was what I meant by "or something". > (I think we should prefer vectors to lists in > this case, because consing them is slightly faster, and the number of > elements is known in advance and fixed.) No argument there, though harfbuzz features, if we ever add them, probably should be added as a list inside the vector. I'm talking about things like "kern=0" passed to hb_feature_from_string, then to hb_shape, to disable kerning.