unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: "Jan Djärv" <jan.h.d@swipnet.se>
Cc: 17486@debbugs.gnu.org, Christian Lynbech <christian@defun.dk>
Subject: bug#17486: 24.4.50; set-face-font problem on OSX
Date: Sun, 18 May 2014 20:17:53 +0400	[thread overview]
Message-ID: <5378DD31.8090604@yandex.ru> (raw)
In-Reply-To: <40E1EC60-3BC6-491D-ACF2-13DFF19B03A2@swipnet.se>

[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]

On 05/18/2014 11:19 AM, Jan Djärv wrote:

>> Could you please check whether set-face-font hits one of the following extra easserts?
>>
>
> ../../current/src/font.c:3311: Emacs fatal error: assertion failed: NILP (entity) || FONT_ENTITY_P (entity)
>
> (gdb) pp entity
> [#<font-entity ns apple Menlo nil iso10646-1 medium normal normal 0 nil 100 0 nil>]

Hm... so font_matching_entity sometimes returns [#<font-entity>] instead of #<font-entity>.
Something may be wrong with font cache or with font driver-specific match routine.
An output of (frame-font-cache) looks correct, so let's check both cases with the following
patch. My output looks like:

font_matching_entity: matched entity nil
font_matching_entity: matched entity #<font-entity x Misc Fixed ## JISX0201\.1976-0 medium r normal 14 75 110 70 nil>
font_matching_entity: matched entity nil
font_matching_entity: matched entity #<font-entity x Misc Fixed ## JISX0201\.1976-0 medium r normal 14 75 110 70 nil>
font_matching_entity: matched entity nil
font_matching_entity: matched entity #<font-entity x Sony Fixed ## JISX0201\.1976-0 medium r normal 16 100 110 80 nil>
font_matching_entity: matched entity nil
font_matching_entity: matched entity #<font-entity x Sony Fixed ## JISX0201\.1976-0 medium r normal 24 100 110 120 nil>
font_matching_entity: matched entity nil

and I do not see 1-item vectors here.

Dmitry


[-- Attachment #2: bug17486_extra_easserts_debug_print.patch --]
[-- Type: text/x-patch, Size: 1205 bytes --]

=== modified file 'src/font.c'
--- src/font.c	2014-04-05 19:30:36 +0000
+++ src/font.c	2014-05-18 16:11:09 +0000
@@ -2803,10 +2803,16 @@
 	ASET (work, FONT_TYPE_INDEX, driver_list->driver->type);
 	entity = assoc_no_quit (work, XCDR (cache));
 	if (CONSP (entity))
-	  entity = XCDR (entity);
+	  {
+	    entity = XCDR (entity);
+	    fprintf (stderr, "%s: cached entity ", __func__);
+	    debug_print (entity);
+	  }
 	else
 	  {
 	    entity = driver_list->driver->match (f, work);
+	    fprintf (stderr, "%s: matched entity ", __func__);
+	    debug_print (entity);
 	    if (!NILP (entity))
 	      {
 		Lisp_Object copy = copy_font_spec (work);
@@ -3299,6 +3305,7 @@
   Lisp_Object entity, name;
 
   entity = font_find_for_lface (f, attrs, spec, -1);
+  eassert (NILP (entity) || FONT_ENTITY_P (entity));  
   if (NILP (entity))
     {
       /* No font is listed for SPEC, but each font-backend may have
@@ -3307,6 +3314,7 @@
       if (NILP (entity))
 	return Qnil;
     }
+  eassert (NILP (entity) || FONT_ENTITY_P (entity));
   /* Don't lose the original name that was put in initially.  We need
      it to re-apply the font when font parameters (like hinting or dpi) have
      changed.  */


  reply	other threads:[~2014-05-18 16:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 18:21 bug#17486: 24.4.50; set-face-font problem on OSX Christian Lynbech
2014-05-16  5:06 ` Jan Djärv
2014-05-16 13:33   ` Jan D.
2014-05-16 14:53     ` Dmitry Antipov
2014-05-16 15:13       ` Jan Djärv
2014-05-16 15:46         ` Dmitry Antipov
2014-05-17  6:46           ` Jan Djärv
2014-05-18  5:43             ` Dmitry Antipov
2014-05-18  7:19               ` Jan Djärv
2014-05-18 16:17                 ` Dmitry Antipov [this message]
2014-05-18 18:33                   ` Jan Djärv
2014-05-19  3:38                     ` Dmitry Antipov
2014-05-19  6:05                       ` Jan D.
2014-05-21 15:13 ` bug#17486: Done Jan Djärv

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5378DD31.8090604@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=17486@debbugs.gnu.org \
    --cc=christian@defun.dk \
    --cc=jan.h.d@swipnet.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).