From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#54562: 28.0.91; Emoji sequence not composed Date: Mon, 28 Mar 2022 14:46:09 +0200 Message-ID: <875ynytfce.fsf@gmail.com> References: <87bkxu8k7t.fsf.ref@yahoo.com> <87bkxu8k7t.fsf@yahoo.com> <83wngiba3j.fsf@gnu.org> <874k3m8grb.fsf@yahoo.com> <87pmmauwtp.fsf@gmail.com> <87y20y6ypi.fsf@yahoo.com> <83pmmab53s.fsf@gnu.org> <87sfr66sb7.fsf@yahoo.com> <87a6deunjj.fsf@gmail.com> <87k0ch5x8k.fsf@yahoo.com> <83h77lb6km.fsf@gnu.org> <871qyod5d5.fsf@gnus.org> <87zglc2q14.fsf@yahoo.com> <87y20vtor6.fsf@gmail.com> <87a6db2ajo.fsf@yahoo.com> <87mthatt5h.fsf@gmail.com> <838rsu9twq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3841"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, larsi@gnus.org, 54562@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 28 14:47:30 2022 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 1nYomQ-0000tt-1i for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Mar 2022 14:47:30 +0200 Original-Received: from localhost ([::1]:51160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYomO-0000yn-LU for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Mar 2022 08:47:28 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYoly-0000xB-Qb for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2022 08:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35356) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nYoly-0007LR-HK for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2022 08:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nYoly-0000PX-Cq for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2022 08:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Mar 2022 12:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54562 X-GNU-PR-Package: emacs Original-Received: via spool by 54562-submit@debbugs.gnu.org id=B54562.16484715841529 (code B ref 54562); Mon, 28 Mar 2022 12:47:02 +0000 Original-Received: (at 54562) by debbugs.gnu.org; 28 Mar 2022 12:46:24 +0000 Original-Received: from localhost ([127.0.0.1]:57486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYolI-0000OX-GO for submit@debbugs.gnu.org; Mon, 28 Mar 2022 08:46:23 -0400 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:45870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYolG-0000OJ-1t for 54562@debbugs.gnu.org; Mon, 28 Mar 2022 08:46:18 -0400 Original-Received: by mail-wr1-f41.google.com with SMTP id w4so20178539wrg.12 for <54562@debbugs.gnu.org>; Mon, 28 Mar 2022 05:46:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version; bh=8wYBacFM4tZti6Qk1wCa6RVxY1oPDQc+EqCDypq9T4U=; b=HgWnhJjwIaB8FJrSoWr0c+iVkFAjRatVRrWAWMO5Y4kBCuJLjMt0VsZ4dencmZVqly xYS/BYZTyFlfAiDfVZhQvE6stPhP2DAp59rQs5uBqGD4WkTBBNVnEnvSbamgS7vxGUfF jc+nJ8GjJAh9GOqtLnwShzqPs5mdCrcyUefLtFtD00G8xA8Vt2Y7Qz9HWaGzSD1235JP TQA80UCzi9//Pu3OD57cpGVkYlVwWbLIs8RbryQUVBx1TsLLlUUVnKCs3qXaDHTe4Urv 0i5vqNQbw5/stL2ZWVN+mLokhgO3deU9zXGrD8jUWSaMTnMUTl9BTTiJwHvxGPl3b6kS nNUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version; bh=8wYBacFM4tZti6Qk1wCa6RVxY1oPDQc+EqCDypq9T4U=; b=NodpTzOIYm7VFZ8fckyPFg25K2SlwvjXh/LiNPgqfzo8WK3HyUyxWlkf6zlhIuU9IJ VCqVxWVKS5JjUiAROZE589+gYl3HbS2gToS4ALHIQYPxT4eqYdy7QELpjf2F9LTS8Pp6 FCaT5w+a6lWOW8oTT9Tanm9Md7SXwuoPPlI8YXzobZQYDAoUFX/Hc5ggHKhrbTguJcPr sCme3UKDf87oPj0T0N7GjWfy1iTLZcbDpw8Ja4YX3Mfp/fDr3HLuubxVnmoRhLiBa5MI zG256cq6GnyVRHnVOfoY6ZUU5v33umCzL38ZzdLlDW4QLqVLkXyT7MJXEWrjDF2QSOpN nEbw== X-Gm-Message-State: AOAM530Sqdq8fSAFi+kHwBrsUF+YC3+EoU9RanKMKLs3rqe/sicI6oFy WOjTDzW3croQNncie3YPJ38kdRqbMTI= X-Google-Smtp-Source: ABdhPJwpRghKrOfSJAWukjhlwI5nh64asdgEf2a9BXlMxXVMbgiwhm5BB6gZU1hXxV2NGGl8hd3Cng== X-Received: by 2002:a5d:6b0b:0:b0:1ef:d826:723a with SMTP id v11-20020a5d6b0b000000b001efd826723amr24008128wrw.420.1648471571624; Mon, 28 Mar 2022 05:46:11 -0700 (PDT) Original-Received: from rltb ([2a01:e0a:3f3:fb50:d210:de9:1c4b:510a]) by smtp.gmail.com with ESMTPSA id r15-20020a5d6c6f000000b002040552e88esm14040490wrz.29.2022.03.28.05.46.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 05:46:10 -0700 (PDT) In-Reply-To: <838rsu9twq.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 28 Mar 2022 14:51:49 +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:229010 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>>>> On Mon, 28 Mar 2022 14:51:49 +0300, Eli Zaretskii said: >> From: Robert Pluim >> Cc: Lars Ingebrigtsen , 54562@debbugs.gnu.org, Eli >> Zaretskii >> Date: Mon, 28 Mar 2022 09:47:54 +0200 >>=20 >> OK. So it sounds like we should perhaps look at doing composition for >> the codepoints in that block by doing face lookup based on the >> combining character rather than the base character. Eli> I guess we should try. It should be optional behavior, because Em= acs Eli> never did that, and I cannot predict what will that do to all the Eli> different use cases where we compose text, and thus whether users = will Eli> like that in all the cases. It could, for example, mean that a Eli> particular Latin character with a diacritic will be displayed with= a Eli> font that's different from the rest of the Latin text, which some Eli> users might consider worse than seeing just the base character in = the Eli> "expected" font. And that's just the simplest use case. Yes, that=CA=BCs exactly what happens with U+0308 here sometimes, see screenshot below. I had to search a bit to find a font to use as the default that didn=CA=BCt have a glyph for U+0308, so I=CA=BCm not sure how important this issue is in practice. Eli> And I think "based on combining character" is not the correct Eli> definition. We should allow selection of the font based on the Eli> character that triggered the composition, i.e. the character whose Eli> slot in composition-function-table stores the rule which we are us= ing Eli> to produce the composition. Like we already do for Emoji. For Eli> combining characters, the default is that the combining character = is Eli> that trigger. By contrast, today we use the font for the first Eli> character in the composition sequence (NOT the base character, as I Eli> incorrectly wrote earlier, although in practice it is the same for Eli> Latin). Imprecise wording on my part. It would indeed be the triggering character, as with emoji. >> Eli, should we look at doing that for other combining characters, >> such as Andreas' 0308? Eli> "Look at" in what sense? 'consider' Rough patch attached. It does U+20E3, U+0308, and U+20D0..U+20FF. It works kind of ok, but U+006F U+0308 suffers from the font problem you were worried about. With Bitstream Vera Mono, the composed glyph ends up being from Latin Modern Roman, which looks very different. The composed glyphs for U+20D0..U+20FF look pretty bad in all the fonts I=CA=BCve tried so far: Unifont, FreeSans, Free Mono, Menlo, Bitstream Vera Mono. Does anyone have an idea of a good font for those? Robert --=20 --=-=-= Content-Type: image/png Content-Disposition: inline; filename="0308 font difference.png" Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAGAAAABhCAYAAAApxKSdAAAABHNCSVQICAgIfAhkiAAAABl0RVh0 U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AAAe6SURBVHic7Z17UFTXHce/u7wiAivIYxQi EbAOWtBCTNZHYgFpYnxsGSfTDrGxpJkk7YyTGdO0aZvYxhKTPsak6qCp2oZagyVOXtaq0ZpuVUCF AkYSERUVRDeCsCtBcIFf/xDYu+uyrN67/HDy+8zszJ699xy+8D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ZM1Hn+E3ojN40iAwb7hfQUkvgI/fTvx8k6yMrurXWCKD77BSo8fIFaLZX08aY/0m9//Sr9fuMO OtrURk3l/6CVpkkU7PU1YW1yaoUmU5ArPbZ6lB0wo+rsJVxpuYbeUeGIirkXycYsPJwSBU8LAZ7u FREcOw0zUhMRGzkKnS1NOHfiGCovtGOwYykNca8INTm1wicCVAWSm3UIw4kIYEYEMCMCmBEBzIgA ZkQAMyKAGRHAzIi7beXd8O5VS2QEMCMCmBEBzIgAZkQAMyKAGRHAjAhgRgQwIwKYEQHMiABmRAAz IoAZEcCMCGBGBDAjApj5P4CS4iF4vd/1AAAAAElFTkSuQmCC --=-=-= Content-Type: text/plain diff --git i/admin/unidata/emoji-zwj.awk w/admin/unidata/emoji-zwj.awk index 3d605d5d64..331095d56f 100644 --- i/admin/unidata/emoji-zwj.awk +++ w/admin/unidata/emoji-zwj.awk @@ -69,6 +69,7 @@ END { # emoji sequences. We have code in font.c:font_range that will # try to display them with the emoji font anyway. + trigger_codepoints[0] = "20E3" trigger_codepoints[1] = "261D" trigger_codepoints[2] = "26F9" trigger_codepoints[3] = "270C" diff --git i/src/font.c w/src/font.c index 7e0219181c..265bec6ce5 100644 --- i/src/font.c +++ w/src/font.c @@ -3937,6 +3937,14 @@ codepoint_is_emoji_eligible (int ch) return false; } +static bool +codepoint_is_combining_lookup_eligible (int ch) +{ + if ((0x20D0 <= ch && ch <= 0x20FF) || ch == 0x308) + return true; + return false; +} + /* Check how many characters after character/byte position POS/POS_BYTE (at most to *LIMIT) can be displayed by the same font in the window W. FACE, if non-NULL, is the face selected for the character at POS. @@ -3996,6 +4004,13 @@ font_range (ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t *limit, val = AREF (val, 0); font_object = font_for_char (face, XFIXNAT (val), pos, string); } + } else if (codepoint_is_combining_lookup_eligible (ch)) + /* If the triggering codepoint is a combining character, use the + font of that character rather than the font of the base + character, since that increases the chances of composition + working. */ + { + font_object = font_for_char (face, ch, pos, string); } while (pos < *limit) --=-=-=--