From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Display certain glyphs with paddings on the side Date: Tue, 3 Dec 2019 15:00:19 -0500 Message-ID: References: <87CA0401-1087-45C1-A952-DB8624C04D32@gmail.com> <83immylmpu.fsf@gnu.org> <83d0d5jom5.fsf@gnu.org> <83a789jk8c.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="25210"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 03 22:03:24 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1icFKN-0006Pg-Dh for ged-emacs-devel@m.gmane.org; Tue, 03 Dec 2019 22:03:23 +0100 Original-Received: from localhost ([::1]:58546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icFKI-0003Os-VY for ged-emacs-devel@m.gmane.org; Tue, 03 Dec 2019 16:03:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58413) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icELj-0001ac-Q6 for emacs-devel@gnu.org; Tue, 03 Dec 2019 15:00:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icELb-0007Zq-Ah for emacs-devel@gnu.org; Tue, 03 Dec 2019 15:00:36 -0500 Original-Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]:33169) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1icELa-0006fW-1V; Tue, 03 Dec 2019 15:00:35 -0500 Original-Received: by mail-qk1-x730.google.com with SMTP id c124so4782456qkg.0; Tue, 03 Dec 2019 12:00:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=N8LOLod/xP+B1z80mmCroa/HWCcYI00rXZh353cYWdk=; b=pmTIhr4RJYntYfwxRP0IJJWDUsrh23v/yJrR76M6usbQllRpCfiIhybguux9CqwSiH 7H2NiJrakOZVaJ7VrLkpbeNazs/kH3F83DmDHMaVPa/1DXprgr5vK/DBj5mtI+eYXEAA eSWmegvUucYPLIOXY2sSG0PF0BNLUf0hYZKiVeDHkSOWRKR5BNVMLAPQuilOC6v5EQDQ /EajXMev7N4YvPqF78aasoOEE6DC+Zh4ER30TzBwsCsgjMQQytrAuV08V8AcIsOtc46k XmVaQ31TvQg/em3I8F+LBCcQfBBEumFFDo4rkon6iwZvr5LFZCVKZawysBhznu45WLY0 LzEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=N8LOLod/xP+B1z80mmCroa/HWCcYI00rXZh353cYWdk=; b=dijA54zn4HZBCAjB3uhwurPm/LoTQE9+8EGNX1/xS9SU3cz7EDwmixGl+ihFj4V9nu OgL3iG6Yo3P0yEXV7lUH1OkGIOFbUZq6EvalMVMc8Xd8iRaX2h1ECPOsfD8AIIv1ca30 Y2YL5CE9/FXkQ7rvo3CIk7jF/ZbQrEXUpWPgad6Lmni/J4t/TwBW5oz1BGGvcdoEv01J Act+pMeYayCVWssQQzh9oqquHTX6zROPkruAXfzTeLAssAQajMkM7Gg6iQJfqsYg2yyp j1LCxZ3SYKdfh8wGdo4iA81iUlIcLXaMxtQppzfeB+588AVgzeArhQaj5ltE3EpIGmHn LtQQ== X-Gm-Message-State: APjAAAVeJfloFaZNTEKqreIxrYoU60uXlT7fIF3A1UmAtjh199IpKBy6 cDGdNSAZdI29OmvXhNEcNFOFWOlU X-Google-Smtp-Source: APXvYqxuslxlQy37bWIZTPChb3u3injN3Q+h3VbwZ7goqTeS6An1uwp4aVur36HOlE7dYDu15gCYag== X-Received: by 2002:a05:620a:1275:: with SMTP id b21mr6748684qkl.363.1575403220953; Tue, 03 Dec 2019 12:00:20 -0800 (PST) Original-Received: from ?IPv6:2603:400a:0:82c:fff0:4e82:4e43:cc9e? ([2603:400a:0:82c:fff0:4e82:4e43:cc9e]) by smtp.googlemail.com with ESMTPSA id k62sm913025qkc.95.2019.12.03.12.00.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Dec 2019 12:00:20 -0800 (PST) In-Reply-To: <83a789jk8c.fsf@gnu.org> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::730 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243090 Archived-At: On 2019-12-03 14:13, Eli Zaretskii wrote: >> Cc: emacs-devel@gnu.org >> From: Clément Pit-Claudel >> Date: Tue, 3 Dec 2019 13:43:33 -0500 >> >>> No, character composition does nothing to the width of glyphs on >>> display. We take the width from the glyph metrics reported by the >>> font. >> >> For the OP's purpose, I think character composition is "enough", in the sense that it can be used to display a glyphs with padding on the sides (as far as I know, composition can't be used to shrink a glyph, however). >> >> Concretely, I'm think of this: >> >>   (insert (compose-string "a" 0 1 '(?\s (br . bl) ?\s (bc . bc) ?我))) >> >> If I'm reading the spec correctly, this should draw the character 我 with padding on both sides to reach the width of two spaces (assuming the choice of fonts is such as 我 is narrower than two spaces to being with). > > This isn't really workable in practice. Sorry, my point wasn't that the OP should do that; rather, I was pointing out that the display engine was powerful enough to achieve the desired result. Ideally, what I'd love to have is a mode that implements a grid-like layout, where each character occupies an exact multiple of the base character width, regardless of which font it comes from. Deciding what this multiple should be for each character could be done in various ways; for my purposes (and for OP's case as well, I think), it would be enough to use one cell for halfwidth characters, two for fullwidth characters, and add a few exceptions for things like TAB and zero-width spaces (I'm using the terms fullwidth and halfwidth in the sense of https://www.unicode.org/reports/tr11/). Should I open a bug report about this? Cheers, Clément.