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 22:11:34 +0900 Message-ID: References: <42b562540806060552q622e3dfvb35820ec28dc66d3@mail.gmail.com> <4849AAE4.4080404@gnu.org> <42b562540806061941p2c2d2ebfg734c2d7c4afbbd28@mail.gmail.com> <484F8E81.8050604@gnu.org> <42b562540806110351p699e4ad8l19b5841724eef431@mail.gmail.com> <484FC664.1070403@gnu.org> 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 1213189982 29756 80.91.229.12 (11 Jun 2008 13:13:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Jun 2008 13:13:02 +0000 (UTC) Cc: yujie052@gmail.com, emacs-devel@gnu.org To: Jason Rumney Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 11 15:13:41 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 1K6Q82-0001eY-MY for ged-emacs-devel@m.gmane.org; Wed, 11 Jun 2008 15:12:42 +0200 Original-Received: from localhost ([127.0.0.1]:39242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6Q7E-0003m1-Tv for ged-emacs-devel@m.gmane.org; Wed, 11 Jun 2008 09:11:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6Q7A-0003lR-TR for emacs-devel@gnu.org; Wed, 11 Jun 2008 09:11:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6Q79-0003ku-FO for emacs-devel@gnu.org; Wed, 11 Jun 2008 09:11:48 -0400 Original-Received: from [199.232.76.173] (port=49750 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6Q79-0003kl-C6 for emacs-devel@gnu.org; Wed, 11 Jun 2008 09:11:47 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:59804) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K6Q72-0002ti-Ps; Wed, 11 Jun 2008 09:11:41 -0400 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id m5BDCCuW008509; Wed, 11 Jun 2008 22:12:12 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id m5BDBZaq019864; Wed, 11 Jun 2008 22:11:35 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id m5BDBYPY017872; Wed, 11 Jun 2008 22:11:34 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.69) (envelope-from ) id 1K6Q6w-0006Lq-S8; Wed, 11 Jun 2008 22:11:34 +0900 In-reply-to: <484FC664.1070403@gnu.org> (message from Jason Rumney on Wed, 11 Jun 2008 13:34:44 +0100) 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:98950 Archived-At: In article <484FC664.1070403@gnu.org>, Jason Rumney writes: > Kenichi Handa wrote: > > 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. > Does that mean that the encoding will eventually be done in generic > code, so I should avoid fixing this in w32font.c? No. The encoding and decoding must be done in each font backend because only the backend knows how to do that. > > 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. > The problem appears to be that the system API used in one of the > encode_char functions on Windows (I don't know whether it is uniscribe > or gdi) seems to return a space glyph for unsupported characters in some > fonts, instead of 0 (which is ".notdef" according to the truetype spec). It seems that this is a serious problem, but it's unbelievable that Windows doesn't have a proper API to check whether a font supports a specific character or not. > Perhaps C-u C-x = should also report which font backend a font belongs > to, to make tracking these sorts of bugs down easier. Ok, I'll add that soon. > > 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. > > > Ah, that explains a lot. > > Perhaps, we should not try the frame font for a certain > > group of charcters (e.g. han, indic, ??). > > > Where is the has_char function used? On Windows, this should work to > filter out unsuitable fonts, as it checks the character against the > font's supported scripts. The has_char method is called in fontset_find_font (in fontset.c) to decide that the selected font is usable for a specific character. --- Kenichi Handa handa@ni.aist.go.jp