From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Kai Ma Newsgroups: gmane.emacs.devel Subject: Re: Text shadows Date: Sun, 12 Mar 2023 17:23:40 +0800 Message-ID: <795E6DF6-EC17-4E68-B8A7-A99E81B072C7@gmail.com> References: <72650A07-DEC8-4E08-A524-5C7AF804F3CB@gmail.com> <83mt4iv3xa.fsf@gnu.org> <87356acq6a.fsf@yahoo.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_335C7CB6-0385-4736-AEAD-0F79F6B4F7F8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27710"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 12 10:24:31 2023 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 1pbHwN-0006xW-6O for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Mar 2023 10:24:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbHvs-0006mX-DE; Sun, 12 Mar 2023 05:24:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbHvq-0006gn-OR for emacs-devel@gnu.org; Sun, 12 Mar 2023 05:23:58 -0400 Original-Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pbHvp-0004RV-3N; Sun, 12 Mar 2023 05:23:58 -0400 Original-Received: by mail-pj1-x1043.google.com with SMTP id mg1so1141570pjb.0; Sun, 12 Mar 2023 01:23:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678613035; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=7VmH+hi7Dbrr0qkiWD3dWa2FbibMey8cyQa28ji4R80=; b=ciRu8lIRGQ/MDomJqJn8ehWFhnVsBx85la3xCCfwr6VcbWDNyfDPZHA4vrpT70f9fV KNlVfA8otXdP0wTDCI4MTmeTlGW7vPYOEhZ6OFZTtq9H0AykEEDvy+8oeZ/0GvSZlkcg x8kmBIhOwXAyfoi19JSbHObrT0cue3dmpyP2hd6VfHwQbI2+hspcV6f263MVjlkI5P2B ti60hZfPy7FYGzOwzCQff2T7pn+3PqeGl3tIAS6urKSoCWxHdPvmakeBdVsr4gF9I13h M/lEND+fIUcFT64IhDVnT15b6anXoxEqZXaXaiuZTOVa7CYwU6Qm/2P1//o4/pR7SkxA VHaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678613035; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7VmH+hi7Dbrr0qkiWD3dWa2FbibMey8cyQa28ji4R80=; b=SGMtYzBEXkgDMBlHkmK+Ph+qiO4+wIM9vcJBZ7tEcSYWR1QpevfmhvVIgr0SeUwnb8 aYwwtH+aTXXsp5ogzTk8q72SpuM3c+DGRGwjX4y0Zh19/A0K+IlUkrbSzpRNvR9FH3fJ 5GekKAcZjCcLd9K72QtomldE9r43W3g+zM5EpJFpPdFG4v5TyPwEub3bmUdP0CE2ReGg qXJ7U3Rn4RgT/sgDVWdLBBQ11P14m68wLdF42mPOETd60DlAA39do1NiOHcFUDvWGvki UF7WOzsVGXJJmysoDcglmCUFCI7YSXMcKjKcggy+UO67QK5bSA4izjMKe41XGyDb0ish q7/w== X-Gm-Message-State: AO0yUKWv4c4vxaZgzgqLYrCpCs3GQZPKwgGntu2zbZKs44c4B9vQY7s8 FoyXLcFYcfUru3MDVhVh7AI= X-Google-Smtp-Source: AK7set8J4Se8NfWPSyJdXDMHF0SQgvunghyAJkqt1a+AFgttNO6FxUdLNc8HS3NIiEWJra4eJxUX8A== X-Received: by 2002:a17:902:f548:b0:19e:29bd:8411 with SMTP id h8-20020a170902f54800b0019e29bd8411mr37747660plf.30.1678613035206; Sun, 12 Mar 2023 01:23:55 -0800 (PST) Original-Received: from smtpclient.apple ([2404:c800:922f:d3b:9cf2:fcff:fecc:2ed2]) by smtp.gmail.com with ESMTPSA id kp12-20020a170903280c00b0019a9436d2a0sm2600558plb.89.2023.03.12.01.23.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Mar 2023 01:23:54 -0800 (PST) In-Reply-To: <87356acq6a.fsf@yahoo.com> X-Mailer: Apple Mail (2.3731.400.51.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::1043; envelope-from=justksqsf@gmail.com; helo=mail-pj1-x1043.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 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, FROM_LOCAL_NOVOWEL=0.5, 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.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304357 Archived-At: --Apple-Mail=_335C7CB6-0385-4736-AEAD-0F79F6B4F7F8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 12, 2023, at 16:46, Po Lu wrote: >> Theoretically, nothing. I targeted Cairo because (I think) it is the = most popular option on GNU/Linux. >>=20 >> Speaking of this specific implementation, gaussian_blur() relies on a = specific Cairo image format ARGB32, (this assumption could be easily = removed), and then it is used by ftcrfont_draw() to generate shadows. >>=20 >> I don=E2=80=99t know whether non-Cairo builds (non-cairo X, win32) = can/should use gaussian_blur() though, since I=E2=80=99m not familiar = with them. >=20 > Non-Cairo builds and Cairo builds alike should use the X Rendering > Extension, where an arbitrary blur kernel is a standard picture = filter. > Cairo builds on X should as well. I agree XRender should be used for non-Cairo X builds (when XRender is = available). But it=E2=80=99s probably not a good idea to use XRender on X+Cairo. In = this setting, cairo_show_glyphs is used to draw glyphs, but Cairo does = not expose any interface to the underlying Picture object. So it would = require additional memory copies between X and Cairo just for blurring. = I guess it would be slower as the image to blur is usually small. I = will do the benchmarks once I get XRender blurring working. > P.S: the GNU project rejects the Unix convention that `foo()' refers = to > the function `foo': `foo()' is a function declarator that returns int > and takes any number of arguments, or alternatively a function call to > `foo' with no arguments. Point taken. --Apple-Mail=_335C7CB6-0385-4736-AEAD-0F79F6B4F7F8 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On Mar 12, = 2023, at 16:46, Po Lu <luangruo@yahoo.com> = wrote:
Theoretically, = nothing.  I targeted Cairo because (I think) it is the most popular = option on GNU/Linux.

Speaking of this specific implementation, = gaussian_blur() relies on a specific Cairo image format ARGB32, (this = assumption could be easily removed), and then it is used by = ftcrfont_draw() to generate shadows.

I don=E2=80=99t know whether = non-Cairo builds (non-cairo X, win32) can/should use gaussian_blur() = though, since I=E2=80=99m not familiar with them.

Non-Cairo builds and = Cairo builds alike should use the X Rendering
Extension, where an = arbitrary blur kernel is a standard picture filter.
Cairo builds on X should = as well.

I agree = XRender should be used for non-Cairo X builds (when XRender is = available).

But it=E2=80=99s probably not a = good idea to use XRender on X+Cairo.  In this setting, = cairo_show_glyphs is used to draw glyphs, but Cairo does not expose any = interface to the underlying Picture object.  So it would require = additional memory copies between X and Cairo just for blurring.  I = guess it would be slower as the image to blur is usually small.  I = will do the benchmarks once I get XRender blurring = working.

P.S: the GNU project = rejects the Unix convention that `foo()' refers to
the function `foo': = `foo()' is a function declarator that returns int
and takes any number of = arguments, or alternatively a function call to
`foo' with no = arguments.

Point = taken.

= --Apple-Mail=_335C7CB6-0385-4736-AEAD-0F79F6B4F7F8--