From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Paul W. Rankin" via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: Horizontal centering in the display engine Date: Thu, 15 Apr 2021 21:39:59 +1000 Organization: By Dasein Message-ID: References: <66A8ED9D-F4C1-4DC0-9D8D-7EB82EA82DF4@bydasein.com> <83zgy0xc30.fsf@gnu.org> Reply-To: "Paul W. Rankin" Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17973"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Purely Mail via Roundcube/1.4.10 Cc: sbaugh@catern.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 15 13:41:54 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 1lX0Nd-0004cZ-Sq for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Apr 2021 13:41:53 +0200 Original-Received: from localhost ([::1]:44076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX0Nc-0002cu-Sy for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Apr 2021 07:41:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX0MG-00024t-AP for emacs-devel@gnu.org; Thu, 15 Apr 2021 07:40:28 -0400 Original-Received: from sendmail.purelymail.com ([34.202.193.197]:44398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX0MD-0002lp-WC for emacs-devel@gnu.org; Thu, 15 Apr 2021 07:40:28 -0400 DKIM-Signature: a=rsa-sha256; b=Nr1y3VWsTucFQVpfO+wYuqP3w+PzAZgtGCfI1tWLkE6aTtvBK13PqIS7iZeXN3eYfP/xLA0NPeVvCGQaZOskteBA012kizHDqqz9N3J3Y6851xbedK/My/WeXjKpgN4HpYQcvR/y0wKACK4EeaWa/JTbcFtTsRUNKXbrhSvad8Ub/aPOQRc48FwHEba3Dei7LgXwuKEYMG2OyU9alH6bmbJW721TU741FXxj9kdeZMlAzfAIMmsDf2zfLWTNV4M6D5n3OcmMcsLa8XcvE5qPKRFfEzbPCEa08JKPDsEDmsYpEIfG9aF/JZ7TmzCge03eMZY+PhPDnpAtwpAXlcKtbA==; s=purelymail2; d=bydasein.com; v=1; bh=O3ECktyyYAdOrh3UE+lns9m9RQehr0l8SiZQLRsHjok=; h=Received:From:To; DKIM-Signature: a=rsa-sha256; b=rkSgX6j1NiGDdLqfF5frOESPE/w/Deo5EvnngSDPAYVrXguafXk0BvIdtRlEVKyB768FECBLsgaycw20RngIk47fZkRyfTkQwUVc83VYFund489kiFlygZC6Dow+8Wir43oGrvKkZBnF4BHLnHKLzuWse+KzPltX7Glgzh42QpjGIgnkUffKIvW7UhxJ3CMkxu2BdXGSCac75L/8s62XbzY65hH+g7WtzII9A/kZUTT0aQ9hZqGepjaO0qhgzk7IhYdoIJkxlafi1TJltOlg9SchqKLWNIfjnN3KeQFoHgXLfzf7MTqemgz/j5Cpqsg6awzEYicAmpFqt/nvIi1lUw==; s=purelymail2; d=purelymail.com; v=1; bh=O3ECktyyYAdOrh3UE+lns9m9RQehr0l8SiZQLRsHjok=; h=Feedback-ID:Received:From:To; Feedback-ID: 791:353:null:purelymail X-Pm-Original-To: emacs-devel@gnu.org Original-Received: by ip-172-30-0-124.ec2.internal (JAMES SMTP Server ) with ESMTPA ID 1361253271; Thu, 15 Apr 2021 11:39:59 +0000 (UTC) In-Reply-To: <83zgy0xc30.fsf@gnu.org> X-Sender: pwr@bydasein.com Received-SPF: pass client-ip=34.202.193.197; envelope-from=pwr@bydasein.com; helo=sendmail.purelymail.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no 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:268086 Archived-At: On 2021-04-15 17:04, Eli Zaretskii wrote: > This calculation of line-width is, of course, only valid when there's > a single face used by the line's characters. > > Using window-text-pixel-size will produce more accurate results, but > OP's main problem is not how to compute the line's width, it is how to > make the alignment adjust itself automatically to any changes in the > line's text and in the window's width. Yes, just a proof of concept, we need to leave some things for OP to find out themselves ;) If implemented with font-lock, the properties will automatically update when the text is changed, and a hook can be added to window-size-change-functions for the window changing.