From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Eli Zaretskii <eliz@gnu.org>
Newsgroups: gmane.emacs.devel
Subject: Re: Any new method to deal with Emacs Fonts settings puzzles nearly
 every Chinese =?utf-8?Q?emacser=EF=BC=9F?=
Date: Sun, 14 Nov 2021 09:36:48 +0200
Message-ID: <83zgq7ur1r.fsf@gnu.org>
References: <2c676019.21d2.17d19ba2dc8.Coremail.tumashu@163.com>
 <838rxsxes6.fsf@gnu.org>
 <165ffaaf53a0f38af0415eb4e6b7844f@webmail.orcon.net.nz>
 <87bl2nppt6.fsf@163.com> <877ddbpp1y.fsf@163.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="23198"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: psainty@orcon.net.nz, emacs-devel@gnu.org
To: "Feng Shu" <tumashu@163.com>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 14 08:39:18 2021
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
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 <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1mmA6g-0005rV-0q
	for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Nov 2021 08:39:18 +0100
Original-Received: from localhost ([::1]:43292 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1mmA6e-00013d-GO
	for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Nov 2021 02:39:16 -0500
Original-Received: from eggs.gnu.org ([209.51.188.92]:52954)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@gnu.org>) id 1mmA4V-0007kw-ST
 for emacs-devel@gnu.org; Sun, 14 Nov 2021 02:37:03 -0500
Original-Received: from [2001:470:142:3::e] (port=45922 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 <eliz@gnu.org>)
 id 1mmA4V-0006EM-IR; Sun, 14 Nov 2021 02:37:03 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=En0LWPp0eMGqb3ayycx6v2D1mpmvLh/hyReIdWFqKBo=; b=ppTmCDRRv/FECtiP8vAt
 h+jOf8gSjZBku4nqj+PLemR2Lx5KT785SwN3xDUpyJTKRdxqd2ht1kyLcX61AYLPsaDSjJ4f5gp+N
 7u92XOVHB/6+2zuJtYyNJVRuquPbthnYtQH9OTWbcj4ouoetenVkvlmTCQRYhSzA9qyhFTfFnWCk0
 68of8r3eAmYG0idIRXHlg/5zLViENe3jTBbILFRJy6OZoCJe7dypKDj8hP3msLq9w4A8nYzh9+jKu
 zUDtzNr6sik7tnTJRsoRAX5lKXnBhSMslzO6+A+XmjgCH8K0mI7+k0F5WyvfuNoTRTf1b40doVcFG
 8IlSupicP9jkJA==;
Original-Received: from [87.69.77.57] (port=1917 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@gnu.org>)
 id 1mmA4U-00057T-8c; Sun, 14 Nov 2021 02:37:03 -0500
In-Reply-To: <877ddbpp1y.fsf@163.com> (tumashu@163.com)
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=subscribe>
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org
Original-Sender: "Emacs-devel"
 <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
Xref: news.gmane.io gmane.emacs.devel:279389
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/279389>

> From: "Feng Shu" <tumashu@163.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,  emacs-devel@gnu.org
> Date: Sun, 14 Nov 2021 08:18:49 +0800
> 
> "Feng Shu" <tumashu@163.com> writes:
> 
> > Phil Sainty <psainty@orcon.net.nz> writes:
> >
> >> On 2021-11-14 04:21, Eli Zaretskii wrote:
> >>> On GUI frames Emacs takes the width of each character in pixels from
> >>> the font that is being used.
> >>
> >> Potentially Emacs could provide a defcustom mapping of fonts to minimum
> >> character widths, and if the actual width of any character is less than
> >> the customized minimum then the (larger) minimum width is used instead
> >> (I guess padding either side of the character).
> >
> > Maybe we just need a padding api, and let user control the number px or pecent of
> > padding.
> 
>    What about: (font-spec :name "Microsoft Yahei" :padding 2)
> 
>    Mean Micorsoft Yahei will pad 2px to 1 char when showed?

How would you know that the value 2 is the one to use?

This kind of solution sounds like a terrible kludge to me.  It is also
unreliable, because the font designers didn't promise us the padding
value will not have to change when more characters are added.  And the
value depends on the ASCII font being used as well, not just the CJK
font, so even the syntax of the spec is incomplete (it doesn't mention
the ASCII font).

Would someone please investigate how do other GUI editors solve this
problem, and post a summary?  I'm sure there are better solutions than
asking users to provide pixel values for each pair of fonts.