From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Variable pitch text filling Date: Fri, 03 Dec 2021 21:38:08 +0200 Message-ID: <83pmqd7a3j.fsf@gnu.org> References: <87ilwft1ph.fsf@gnus.org> <875ysbxal0.fsf@gnus.org> <83h7bvugxm.fsf@gnu.org> <87sfvessx6.fsf@gnus.org> <87wnkp9c3t.fsf@gnus.org> <87ee6wanra.fsf@gnus.org> <83r1awse4k.fsf@gnu.org> <87sfvc8kdw.fsf@gnus.org> <83czmgs7t1.fsf@gnu.org> <87k0go8ios.fsf@gnus.org> <83bl20s2dp.fsf@gnu.org> <87wnkojmny.fsf@gnus.org> <837dcos1oy.fsf@gnu.org> <87o860jm27.fsf@gnus.org> <831r2ws0jf.fsf@gnu.org> <87fsrcjkik.fsf@gnus.org> <83ee6uao67.fsf@gnu.org> <83sfva92vo.fsf@gnu.org> <83czme85xk.fsf@gnu.org> <877dclzoeo.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6254"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tumashu@163.com, casouri@gmail.com, emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 03 20:42:07 2021 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 1mtERb-0001Tm-Gj for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Dec 2021 20:42:07 +0100 Original-Received: from localhost ([::1]:49874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtERa-0001gA-Eo for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Dec 2021 14:42:06 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtENw-0007Co-Q2 for emacs-devel@gnu.org; Fri, 03 Dec 2021 14:38:22 -0500 Original-Received: from [2001:470:142:3::e] (port=47914 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtENw-0003n3-Fk; Fri, 03 Dec 2021 14:38:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=hIzGdhvJ/sBv8z4SgqXnpXnyv+hJ7Dph/jHVqViIraU=; b=c0lPCEFaZObe yCQ8t6m0kWmYb0udVQ79Cm+A5pDpmzAptv0VUsmZ4F7hCBNwStxE6XJPhI3QcFucX5QELB6KCRV32 A48ADC4c5mHSDz3mAJQaUX1jpe1fDIqwNrn9DVIB1zDh6IUO2BZsCsXWLc+qQbPPJfkbE1TRdPJe7 Ywvb8h36SdwoOmp+DTFixh1OLchGWtQLcNjTjhzEztfSJSiBDf3kwQ+SjqNE6uCXfv7Jkz7wDLy/u alKeNOQ+XCHgPXftOBr2pf/3MGXrVjeiS3NznzzDjPe5ctUcpArzbwouxWgwJZQN2SMDeMbV3RGip hlJc+PwHZDP883ImolBJ2w==; Original-Received: from [87.69.77.57] (port=2390 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtENt-00036X-RP; Fri, 03 Dec 2021 14:38:20 -0500 In-Reply-To: <877dclzoeo.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 03 Dec 2021 16:41:35 +0100) 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" Xref: news.gmane.io gmane.emacs.devel:280865 Archived-At: > From: Lars Ingebrigtsen > Cc: casouri@gmail.com, tumashu@163.com, emacs-devel@gnu.org > Date: Fri, 03 Dec 2021 16:41:35 +0100 > > Eli Zaretskii writes: > > > This is one of the "TIL" situations each one of us has with Emacs from > > time to time. It means my thinking about adding character spacing was > > based on wrong assumptions, and the only way to do that is to add > > stretch glyphs (which can be done only between words). > > Why can stretch glyphs only be added between words? Is it because we > ask the font backend to draw a series of glyphs in one go? Yes. A series of glyphs of the same type (character glyphs, stretch glyphs, composition glyphs, etc.) are collected into a "glyph string" and drawn by the backend in one go. > If that's the case, perhaps we could stop doing that if we're doing a > gridded display? That'd be much slower, I guess? For each such separate glyph we need first clear the background with the color of the face, then draw the glyph itself. Right now, we clear the background for all of the glyphs in one GUI call, then write all of the glyphs in a single call to the font driver. > One other thing that occurred to me (but I didn't look at closely) is > whether it would be feasible to work on the glyph matrix for a line > after it's been composed. I remember you doing some work on that when > we talked about "compressing the mode line" -- I think you basically > went over the matrix and removed some of the space glyphs? (That > approach didn't work for other reasons, but the basic post processing > thing did work, I think?) That'd cause the same problem as above: each character glyph will be drawn separately, because the stretch glyphs in-between them will break the sequence of character glyphs into individual characters. > Do we have enough info about the glyphs at that stage that we could add > some stretch glyphs to gridify the line? Yes, information is not the problem.