From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: A patch for enforcing double-width CJK character display Date: Tue, 17 Apr 2012 14:52:19 +0900 Message-ID: <87r4vmewh8.fsf@catnip.gol.com> References: <87ipgzjdir.fsf@catnip.gol.com> <4F8CDCE1.8030109@i-soft.com.cn> <87wr5fdmpa.fsf@catnip.gol.com> <20120417.065618.393680168.wl@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1334641958 18082 80.91.229.3 (17 Apr 2012 05:52:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 17 Apr 2012 05:52:38 +0000 (UTC) Cc: jianzhong.huang@i-soft.com.cn, emacs-devel@gnu.org To: Werner LEMBERG Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 17 07:52:37 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 1SK1L9-0001VZ-NZ for ged-emacs-devel@m.gmane.org; Tue, 17 Apr 2012 07:52:35 +0200 Original-Received: from localhost ([::1]:57524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SK1L9-0001Wo-1B for ged-emacs-devel@m.gmane.org; Tue, 17 Apr 2012 01:52:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SK1L3-0001WP-2s for emacs-devel@gnu.org; Tue, 17 Apr 2012 01:52:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SK1Ky-0003jD-QH for emacs-devel@gnu.org; Tue, 17 Apr 2012 01:52:28 -0400 Original-Received: from smtp12.dentaku.gol.com ([203.216.5.74]:48769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SK1Ky-0003it-H9; Tue, 17 Apr 2012 01:52:24 -0400 Original-Received: from 61.245.22.233.eo.eaccess.ne.jp ([61.245.22.233] helo=catnip.gol.com) by smtp12.dentaku.gol.com with esmtpa (Dentaku) (envelope-from ) id 1SK1Ku-00018J-PB; Tue, 17 Apr 2012 14:52:20 +0900 Original-Received: by catnip.gol.com (Postfix, from userid 1000) id E6C9FDFC1; Tue, 17 Apr 2012 14:52:19 +0900 (JST) System-Type: x86_64-unknown-linux-gnu In-Reply-To: <20120417.065618.393680168.wl@gnu.org> (Werner LEMBERG's message of "Tue, 17 Apr 2012 06:56:18 +0200 (CEST)") Original-Lines: 24 X-Virus-Scanned: ClamAV GOL (outbound) X-Abuse-Complaints: abuse@gol.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 203.216.5.74 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:149718 Archived-At: Werner LEMBERG writes: >> 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. Er, wait, what? It can be done trivially, by adding 3 pixels of whitespace on both sides of every CJK character... [Which is the source of my concern: that in some cases it might be so much whitespace that the result looks funny.] -miles -- Consult, v.i. To seek another's disapproval of a course already decided on.