From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?6buE5bu65b+g?= Newsgroups: gmane.emacs.devel Subject: Re: A patch for enforcing double-width CJK character display Date: Thu, 12 Apr 2012 00:16:41 +0800 Message-ID: <4F85AE69.9050002@i-soft.com.cn> References: <4F85A138.6090900@i-soft.com.cn> <87vcl646c7.fsf@isil.kanru.info> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1334177724 19921 80.91.229.3 (11 Apr 2012 20:55:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Apr 2012 20:55:24 +0000 (UTC) Cc: eliz@gnu.org, stepnem@gmail.com, emacs-devel@gnu.org To: Kan-Ru Chen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 11 22:55:22 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 1SI4ZW-0007Nd-8g for ged-emacs-devel@m.gmane.org; Wed, 11 Apr 2012 22:55:22 +0200 Original-Received: from localhost ([::1]:46432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SI4ZV-0006OU-NB for ged-emacs-devel@m.gmane.org; Wed, 11 Apr 2012 16:55:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SI0EE-0000bE-16 for emacs-devel@gnu.org; Wed, 11 Apr 2012 12:17:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SI0EB-0000Gj-9q for emacs-devel@gnu.org; Wed, 11 Apr 2012 12:17:05 -0400 Original-Received: from mta319.sina.net ([202.108.3.196]:22946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SI0E6-0000FN-7Q; Wed, 11 Apr 2012 12:16:58 -0400 X-Originating-IP: [111.161.71.6] Original-Received: from unknown (HELO mta319.sina.net) ([10.54.5.137]) by irxd5-207.sina.net with ESMTP; 12 Apr 2012 00:16:45 +0800 Original-Received: by smtp-5-137.sina.net (SINAMAIL, from userid 6663) id 3DC04353054; Thu, 12 Apr 2012 00:16:45 +0800 (CST) Original-Received: from piggy.pure64.org (unknown [111.161.71.6]) by smtp-5-137.sina.net (SINAMAIL) with ESMTPA id 18E41353052; Thu, 12 Apr 2012 00:16:45 +0800 (CST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120327 Thunderbird/10.0.2 In-Reply-To: <87vcl646c7.fsf@isil.kanru.info> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 202.108.3.196 X-Mailman-Approved-At: Wed, 11 Apr 2012 16:55:19 -0400 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:149604 Archived-At: Thanks for reply. I checked with "text-scale-increase" and it did not work. When scale happened, the space_width and column_width of frame did not changed, I need find another way to get monospace font width after scale. But I think we can store the default font face to every xftfont_info and when scale happened, re-caculate the space width of default face. Let me try, thanks for the feedback. 于 2012年04月11日 23:48, Kan-Ru Chen 写道: > [ CC:ed emacs-devel ] > > Hi! > > 黄建忠 writes: > >> Here is a patch to fix double-width issue of CJK fonts when use Xft >> backend , just like some terminal did. > I like you idea to draw glyphs individually when the font is a CJK font. > I didn't realized that when the font changes, XftDrawGlyphs is called > again so we have a chance to examine the font! > > Your patch probably needs some adjust to fit the coding style, but the > approach is great! Did you check that it also works with scaled fonts? > Like (text-scale-increase) multiple times. > > Kanru > > -- 黄建忠 技术总监 普华基础软件股份有限公司 基础软件事业部 电话:010-82664919-8201 传真:010-82664407 手机:13501162460 网址:http://www.i-soft.com.cn 地址:中国北京市海淀区海淀东三街欧美汇大厦9层 邮编:100080