From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Werner LEMBERG Newsgroups: gmane.emacs.devel Subject: Re: A patch for enforcing double-width CJK character display Date: Tue, 17 Apr 2012 06:56:18 +0200 (CEST) Message-ID: <20120417.065618.393680168.wl@gnu.org> References: <87ipgzjdir.fsf@catnip.gol.com> <4F8CDCE1.8030109@i-soft.com.cn> <87wr5fdmpa.fsf@catnip.gol.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1334638599 28710 80.91.229.3 (17 Apr 2012 04:56:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 17 Apr 2012 04:56:39 +0000 (UTC) Cc: jianzhong.huang@i-soft.com.cn, emacs-devel@gnu.org To: miles@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 17 06:56:38 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SK0Sv-0005WW-OQ for ged-emacs-devel@m.gmane.org; Tue, 17 Apr 2012 06:56:33 +0200 Original-Received: from localhost ([::1]:48637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SK0Sv-0002VF-7u for ged-emacs-devel@m.gmane.org; Tue, 17 Apr 2012 00:56:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SK0St-0002VA-3h for emacs-devel@gnu.org; Tue, 17 Apr 2012 00:56:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SK0Sq-0004z7-9V for emacs-devel@gnu.org; Tue, 17 Apr 2012 00:56:30 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:51267) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SK0Sp-0004yt-Uy for emacs-devel@gnu.org; Tue, 17 Apr 2012 00:56:28 -0400 Original-Received: (qmail invoked by alias); 17 Apr 2012 04:56:26 -0000 Original-Received: from p5DE8565C.dip.t-dialin.net (EHLO localhost) [93.232.86.92] by mail.gmx.net (mp012) with SMTP; 17 Apr 2012 06:56:26 +0200 X-Authenticated: #54312696 X-Provags-ID: V01U2FsdGVkX1/dOPh+oRPdgAb83lgCs4TL2ZjagzXdRDgBGYqdf3 jWlQUxBOp6OWt2 In-Reply-To: <87wr5fdmpa.fsf@catnip.gol.com> X-Mailer: Mew version 6.4rc1 on Emacs 24.0.92.1 / Mule 6.0 (HANACHIRUSATO) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149716 Archived-At: > 1) In case 1, a 20-character sequence of ASCII characters takes 180 > pixels to display, and a 10-character sequence of CJK characters > takes 120 pixels to display. Mhmm. The silent assumption of making a CJK and ASCII font fit is that double-width characters are really double width in relation to single-width characters. In your example, the width of two ASCII characters is 18px, while one CJK character is 12px. Such two fonts simply don't fit, and no clever algorithm will be able to make them ever fit without scaling.[1] Your arguments are thus moot IMHO. Werner [1] Not counting a full analysis of all glyphs of a font to check whether it is possible to compress the advance width horizontally because the left and right side bearings are large enough to do that without overlapping.