From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#17973: Thin space not thin at all Date: Thu, 10 Jul 2014 12:37:27 -0400 Message-ID: References: <87a98he19h.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1405023985 14654 80.91.229.3 (10 Jul 2014 20:26:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Jul 2014 20:26:25 +0000 (UTC) Cc: 17973@debbugs.gnu.org To: handa@gnu.org (K. Handa) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 10 22:26:15 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1X5Kv1-0002LZ-Aq for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Jul 2014 22:26:15 +0200 Original-Received: from localhost ([::1]:40033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Kv0-0003MT-TK for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Jul 2014 16:26:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5HMI-0000Pp-Rx for bug-gnu-emacs@gnu.org; Thu, 10 Jul 2014 12:38:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5HMB-0007TD-AA for bug-gnu-emacs@gnu.org; Thu, 10 Jul 2014 12:38:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5HMB-0007T8-4H for bug-gnu-emacs@gnu.org; Thu, 10 Jul 2014 12:38:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X5HMA-0000BD-QB for bug-gnu-emacs@gnu.org; Thu, 10 Jul 2014 12:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Jul 2014 16:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17973 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17973-submit@debbugs.gnu.org id=B17973.1405010257640 (code B ref 17973); Thu, 10 Jul 2014 16:38:02 +0000 Original-Received: (at 17973) by debbugs.gnu.org; 10 Jul 2014 16:37:37 +0000 Original-Received: from localhost ([127.0.0.1]:52381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X5HLk-0000AD-4h for submit@debbugs.gnu.org; Thu, 10 Jul 2014 12:37:36 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:35619) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X5HLh-0000A0-Q0 for 17973@debbugs.gnu.org; Thu, 10 Jul 2014 12:37:34 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgEnLyMFCws0EhQYDVKHVgjSGReOegeEOASUYpQ3gWqDTCE X-IPAS-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgEnLyMFCws0EhQYDVKHVgjSGReOegeEOASUYpQ3gWqDTCE X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="77079927" Original-Received: from 75-119-224-253.dsl.teksavvy.com (HELO pastel.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 10 Jul 2014 12:37:27 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 4E584604AF; Thu, 10 Jul 2014 12:37:27 -0400 (EDT) In-Reply-To: <87a98he19h.fsf@gnu.org> (K. Handa's message of "Thu, 10 Jul 2014 23:28:42 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91411 Archived-At: > Do you customize face-font-selection-order? It's default > value is (:width :height :weight :slant), which means that > the function font_select_entity (called from > font_find_for_lface) selects a font whose :width is > semicondensed even if that font has very different height > from what specified. Ah, right, that explains it. Hmm... I guess ideally, Emacs should consider a height that's "too far" from the requested one as a failure and then try again ignoring some of the specs. The patch below expresses the first part, but it looks like the second part doesn't exit: Emacs just doesn't find any font to use for the "thin space" of C-x SPC and indicates it to me with one of those big squares that say "0020", which is a lot more intrusive than the problem I'm trying to fix. And (setq scalable-fonts-allowed t) doesn't help either. Maybe a solution/workaround for the specific problem of such "thin lines" is to replace the (:height 0.2) face with another face that specifies "any family". If I use (:height 0.2 :family "Monospace"), indeed, the problem disappears. Is there a better "any family" than "Monospace"? Stefan PS: The patch below also happens to give me assertion failures fontset.c:897: Emacs fatal error: assertion failed: fontset_id_valid_p (face->fontset) I haven't investigated any further, tho (and the line number might be off because of local changes anyway). === modified file 'src/font.c' --- src/font.c 2014-07-09 13:45:53 +0000 +++ src/font.c 2014-07-10 16:11:04 +0000 @@ -2165,10 +2165,14 @@ lowest bit is set if the DPI is different. */ EMACS_INT diff; EMACS_INT pixel_size = XINT (spec_prop[FONT_SIZE_INDEX]); + EMACS_INT entity_size = XINT (AREF (entity, FONT_SIZE_INDEX)); if (CONSP (Vface_font_rescale_alist)) pixel_size *= font_rescale_ratio (entity); - diff = eabs (pixel_size - XINT (AREF (entity, FONT_SIZE_INDEX))) << 1; + if (pixel_size * 2 < entity_size || entity_size * 2 < pixel_size) + /* This size is wrong by more than a factor 2: reject it! */ + return 0xFFFFFFFF; + diff = eabs (pixel_size - entity_size) << 1; if (! NILP (spec_prop[FONT_DPI_INDEX]) && ! EQ (spec_prop[FONT_DPI_INDEX], AREF (entity, FONT_DPI_INDEX))) diff |= 1;