From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: Ntemacs chooses wrong font. Date: Wed, 11 Jun 2008 13:34:44 +0100 Message-ID: <484FC664.1070403@gnu.org> 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 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1213187745 21333 80.91.229.12 (11 Jun 2008 12:35:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Jun 2008 12:35:45 +0000 (UTC) Cc: Kevin Yu , emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 11 14:36:27 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 1K6PYx-0003hZ-8m for ged-emacs-devel@m.gmane.org; Wed, 11 Jun 2008 14:36:27 +0200 Original-Received: from localhost ([127.0.0.1]:48413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6PY9-0000gr-GG for ged-emacs-devel@m.gmane.org; Wed, 11 Jun 2008 08:35:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6PY2-0000f4-Bw for emacs-devel@gnu.org; Wed, 11 Jun 2008 08:35:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6PY0-0000cw-6d for emacs-devel@gnu.org; Wed, 11 Jun 2008 08:35:29 -0400 Original-Received: from [199.232.76.173] (port=52082 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6PXz-0000cr-TI for emacs-devel@gnu.org; Wed, 11 Jun 2008 08:35:27 -0400 Original-Received: from mk-outboundfilter-3.mail.uk.tiscali.com ([212.74.114.23]:26143) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K6PXz-0003ak-K7 for emacs-devel@gnu.org; Wed, 11 Jun 2008 08:35:27 -0400 Original-X-Trace: 129056959/mk-outboundfilter-1.mail.uk.tiscali.com/F2S/$ACCEPTED/freedom2Surf-customers/83.67.23.108 X-SBRS: None X-RemoteIP: 83.67.23.108 X-IP-MAIL-FROM: jasonr@gnu.org X-IP-BHB: Once X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEAI9jT0hTQxds/2dsb2JhbACBW68l X-IronPort-AV: E=Sophos;i="4.27,624,1204502400"; d="scan'208";a="129056959" X-IP-Direction: IN Original-Received: from i-83-67-23-108.freedom2surf.net (HELO wanchan.jasonrumney.net) ([83.67.23.108]) by smtp.f2s.tiscali.co.uk with ESMTP; 11 Jun 2008 13:34:54 +0100 Original-Received: from [192.168.249.27] (chiko.jasonrumney.net [192.168.249.27]) by wanchan.jasonrumney.net (Postfix) with ESMTP id C1D3A412; Wed, 11 Jun 2008 13:35:21 +0100 (BST) User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) In-Reply-To: X-Enigmail-Version: 0.95.6 OpenPGP: id=8086879D X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:98946 Archived-At: 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? > 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). Perhaps C-u C-x = should also report which font backend a font belongs to, to make tracking these sorts of bugs down easier. > 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.