From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Julius Pfrommer Newsgroups: gmane.emacs.devel Subject: Re: Unify the Platforms: Cairo+FreeType+Harfbuzz Everywhere (except TTY) Date: Sun, 17 May 2020 20:28:02 +0200 Message-ID: <20200517202802.00006646@web.de> References: <20200517124125.000013a4@web.de> <97C7EAB7-10AB-4702-ABC8-EB6C1C50ABDB@gnu.org> <20200517165953.000044d2@web.de> <83lflqblp0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="54720"; 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 Sun May 17 20:31:28 2020 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 1jaO4O-000EA1-6m for ged-emacs-devel@m.gmane-mx.org; Sun, 17 May 2020 20:31:28 +0200 Original-Received: from localhost ([::1]:34602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaO4M-0006AA-VY for ged-emacs-devel@m.gmane-mx.org; Sun, 17 May 2020 14:31:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaO19-0003wT-IZ for emacs-devel@gnu.org; Sun, 17 May 2020 14:28:07 -0400 Original-Received: from mout.web.de ([212.227.17.12]:47883) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaO18-0004Kw-Cu; Sun, 17 May 2020 14:28:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1589740084; bh=TcmwO1l2NXRgVPbYFuLY1mRTzoGfmiB5wCmgYWPdgEA=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=Ld04EzyN7CmlRLoSCLKu1SHvvCr3ZN6KVoz59I0QtZw0gK4OUilZEujB24ve+3bNX mprsPO3C7AOQS6RihvHNMyWYiw/+JYySlpsk0/0yN4TwHFrHPVCw6eD5vpuZx2gCBP aOlsKANKwH81gYQZfObTVbfTcRlFY5oVkLSH55Kw= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from localhost ([86.243.248.98]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MN4Gi-1jh0mq1j5s-006e4s; Sun, 17 May 2020 20:28:04 +0200 In-Reply-To: <83lflqblp0.fsf@gnu.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) X-Provags-ID: V03:K1:19TkRYTykGOInCbCD/zkKyJOXFiZ9TH+XjQcs0BW+SenlrpVuDQ EL+Xx5KwbFKPaw6AErkHxQ/lUUylf+t1y3VqMa0eN641CHz4F0lwOnhyxJ9quQtcLMpa+FP UaAVtEifmwdTWaaTkvCGVQnq7xWKOuD27FLcihkQzrfsVlLHv/wu3HdY5ZeT8j/fvxFpK/8 zvGKEV5OGDYhjBlg1jDvQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:knPj1CPoa6U=:BdES7eNOEqcz7oa5hbJDYo 13sevJrO60Ff6fpzr+lRvwEomE8P4HYejSIGMLsORzYKxds9ETaXGL0o5qwypON5nc79sUeBq 5KNRFryZzaVtZD999yRDC4jiOIWXWDtQ9HkrwthYvIPqbCGr5c9GwI3LjROfERnCfcaZQXbk1 NBIYt6aeFMfMwZBEt9noaMN8Vm39jbSQRXiHb3Uhr1qOIAJzjZwDNVYHNhZhIfHPxrQM6XpqB 4w9cZzg/zPj+9ANYTJARImMDhNw0biWjQVdOVuOQi1eG6zY+xanmgWrp/tRUaTpPlaHWloABy sHyHVeOfAmfvRUnrnuSzHaFJfgaGCHH2MZsWSnfpHFw81xC7AnqV/+OQ49sEvaCGKglrc6ZzT 6U/a800cdVtkoEaiddCJWAZ5j30AgokyuesbOPQvKTd2cTq7BWCplZFmR/xDQt8qIpwf9ual4 g1NMXG/IWhRULxTiJXO9Bn7upzP3VnzR9EvQ7PK5AmY+k5u2mKk+jEDeJfJSgeimnvOLgXgR2 /JEs5b83LfqrCJlProqAZTjFaKkavojokR10qe9Pr//eXZcexDJ38MZsLeK0kToANfeXpbHCu 4DCqV1fIwx/QuC5h50sbUOSZ43LDEoo0j9RldIEF+8jgHGP9bn5oRLmsUumhuTMfX9URYqv1n mm3Jjwk2iqnZYu6n7vpFlKDDTcE6Vl5taatNuah2jqMIHLXup3lV/EZOOE+x+1E7OeBSrGNiX tvsXfSdP9CfiUtWaJur96SdEBqm1LVnNV6NSua0ZAd+kBVDPa7t65FHtLNSov9pI1qddkn/U Received-SPF: pass client-ip=212.227.17.12; envelope-from=julius.pfrommer@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/17 14:28:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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:250639 Archived-At: > First, we need to establish that this is a solution, and for what > problem(s). It is important to realize that the GUI backends we use > handle much more than just drawing text, they need to be able to > display GUI widgets, frame and window decorations (menu bar, tool bar, > scroll bars, the frame title, etc.), and much more. I am quite supportive of the native GUI toolkits. Cairo is a vector-drawing library and only responsible for the "glass" of each frame (called the "canvas" in other communities). All the event-handling logic, menu-drawing, etc. is untouched by it. > Next, please be aware that we already made the decision to use > HarfBuzz as our main text-shaping engine. X and w32 already use it; Very good to see Emacs settle on HarfBuzz! Text-shaping touches into the very core, as the glyph rendering impacts line-breaking, redisplay, and so on. > I don't think the answer will be full and definitive until "Someone" > walks through all the APIs we implement in x/w32/ns/fns.c and > x/w32/ns/term.c, and makes sure they all can be covered. Looking at xterm.c, it is littered with #ifdef USE_CAIRO. A first step could be to assume Cairo on X-based platforms and remove duplicate code. The second step could be to decouple the "glass" from the tookit "chrome" more thoroughly in xterm.c. That is easier to do when a Cairo-canvas can be assumed for drawing. Then, that entire "glass" could be reused by other platforms once they have a Cairo-canvas for drawing as well. (Modulo the XWidget support that depends on GTK.) Once a switchover is in reach, it can live separately to the existing platform-specific "glass" until all the kinks are worked out. Regards, Julius Am Sun, 17 May 2020 18:55:23 +0300 schrieb Eli Zaretskii : > > Date: Sun, 17 May 2020 16:59:53 +0200 > > From: Julius Pfrommer > > Cc: emacs-devel@gnu.org > > > > Let me phrase the question differently: Would it be okay to have a > > hard dependency on the Cairo+FreeType+Harfbuzz (CFH) libraries, as > > they are available everywhere? > > First, we need to establish that this is a solution, and for what > problem(s). It is important to realize that the GUI backends we use > handle much more than just drawing text, they need to be able to > display GUI widgets, frame and window decorations (menu bar, tool bar, > scroll bars, the frame title, etc.), and much more. Is the > configuration you propose capable of doing all that? I don't think > the answer will be full and definitive until "Someone" walks through > all the APIs we implement in x/w32/ns/fns.c and x/w32/ns/term.c, and > makes sure they all can be covered. > > Next, please be aware that we already made the decision to use > HarfBuzz as our main text-shaping engine. X and w32 already use it; > for NS someone has to write the code (and they are not very likely to > do so because macOS users consider the native text shaping more > feature-rich). Dropping the other font backends is a matter of time, > but it could take a long time. > > In any case, the font backend is not the main issue here; in > particular, the likes of FreeType are hardly even seen except on very > low level of the code. It's the other aspects of GUI code that > bothers me much more. > > > Even on Linux, this would unlock quite a few simplifications. I > > count at least three font handling "backends" here. > > Down to 2 and one deprecated one on master. Bu again, font backends > is a relatively easy problem, and it is being dealt with.