From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: Ntemacs chooses wrong font. Date: Wed, 11 Jun 2008 20:50:53 +0900 Message-ID: References: <42b562540806060552q622e3dfvb35820ec28dc66d3@mail.gmail.com> <4849AAE4.4080404@gnu.org> <42b562540806061941p2c2d2ebfg734c2d7c4afbbd28@mail.gmail.com> <484F8E81.8050604@gnu.org> <42b562540806110351p699e4ad8l19b5841724eef431@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1213185109 11655 80.91.229.12 (11 Jun 2008 11:51:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Jun 2008 11:51:49 +0000 (UTC) Cc: emacs-devel@gnu.org, jasonr@gnu.org To: "Kevin Yu" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 11 13:52:32 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K6Ory-0004dh-JN for ged-emacs-devel@m.gmane.org; Wed, 11 Jun 2008 13:52:02 +0200 Original-Received: from localhost ([127.0.0.1]:34427 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6OrB-000719-2Q for ged-emacs-devel@m.gmane.org; Wed, 11 Jun 2008 07:51:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6Or6-000711-J5 for emacs-devel@gnu.org; Wed, 11 Jun 2008 07:51:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6Or4-00070l-Ke for emacs-devel@gnu.org; Wed, 11 Jun 2008 07:51:07 -0400 Original-Received: from [199.232.76.173] (port=46848 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6Or4-00070i-Cr for emacs-devel@gnu.org; Wed, 11 Jun 2008 07:51:06 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:37220) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K6Oqx-0002Ke-CY; Wed, 11 Jun 2008 07:50:59 -0400 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id m5BBpUxj019229; Wed, 11 Jun 2008 20:51:30 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id m5BBorwY006278; Wed, 11 Jun 2008 20:50:53 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id m5BBorqc011609; Wed, 11 Jun 2008 20:50:53 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.69) (envelope-from ) id 1K6Oqr-0004xw-BO; Wed, 11 Jun 2008 20:50:53 +0900 In-reply-to: <42b562540806110351p699e4ad8l19b5841724eef431@mail.gmail.com> (yujie052@gmail.com) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-kernel: by monty-python.gnu.org: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:98942 Archived-At: In article <42b562540806110351p699e4ad8l19b5841724eef431@mail.gmail.com>, "Kevin Yu" writes: > > > Emacs displays the font family name as:"\320\302\313\316\314\345" > > > > This is a bug, but it should at least be consistent, as there is no > > encoding in either direction. I currently explicitly generate a unibyte string for font names just to avoid the font name encoding problem until the font-backend codes gets stable. > Here's my font related configuration > (set-language-environment "chinese-gb18030") > (set-frame-font "Monaco-10") > (set-fontset-font (frame-parameter nil 'font) > 'han '("Microsoft Yahei"."unicode-bmp")) > (set-fontset-font (frame-parameter nil 'font) > 'symbol '("Microsoft Yahei"."unicode-bmp")) > (set-fontset-font (frame-parameter nil 'font) > 'cjk-misc '("Microsoft Yahei"."unicode-bmp")) > (set-fontset-font (frame-parameter nil 'font) > 'bopomofo '("Microsoft Yahei"."unicode-bmp")) Emacs at first checks if a charater is supported by the frame font (here "Monaco-10") to avoid unnecessary looking up of fontset table . If supported, the frame font is used. And, in your case, the font backend on Windows says that the frame font supports it. That is the problem. > if I open a existed file with Chinese characters, everything goes well. It seems that you saved the file with some of legacy encoding (e.g. euc-cn, big5). On reading such a file, Emacs adds a charset text-property (e.g. chinese-gb2312, big5), and if a character has such a property, Emacs doesn't try the frame font, but does a normal fontset looking up (because `charset' information may change the priority of fonts). So, your fontset setting above takes effect. Perhaps, we should not try the frame font for a certain group of charcters (e.g. han, indic, ??). --- Kenichi Handa handa@ni.aist.go.jp