« Return to Thread: set-fontset-font and preferred charset?

Re: set-fontset-font and preferred charset?

by YAMAMOTO Mitsuharu :: Rate this Message:

Reply to Author | View in Thread

>>>>> On Wed, 08 Jul 2009 17:09:35 +0900, YAMAMOTO Mitsuharu <mituharu@...> said:

>>>>> On Wed, 08 Jul 2009 16:44:50 +0900, Kenichi Handa <handa@...> said:
>>> 3. When I open "HELLO" file, some (not all) Japanese characters in
>>> other buffers start to be rendered using xft backend.  When I open
>>> another X frame, the font suddenly change to X font (both old and
>>> new frames).

>> There was a silly bug in handling a preferred charset in
>> fontset_find_font.  I've installed a fix for the trunk.

> Could you try compiling it with -DENABLE_CHECKING?  I got

> .../src/fontset.c:618: Emacs fatal error: assertion failed:
> VECTORLIKEP((rfont_def))

> with the current trunk code when I tried C-h h.  It doesn't happen
> with the EMACS_23_1_RC branch.

When the assertion failure happened, found_index == -1,
charset_matched == -1, and i == 0.  The negative found_index is
problematic because it is used as an index for AREF.

Perhaps the following condition was missing?

Index: src/fontset.c
===================================================================
RCS file: /sources/emacs/emacs/src/fontset.c,v
retrieving revision 1.177
diff -c -p -r1.177 fontset.c
*** src/fontset.c 8 Jul 2009 03:49:12 -0000 1.177
--- src/fontset.c 8 Jul 2009 08:41:15 -0000
*************** fontset_find_font (fontset, c, face, id,
*** 575,581 ****
        Lisp_Object font_def;
        Lisp_Object font_entity, font_object;
 
!       if (i == 0)
  {
   /* Try the element matching with the charset ID at first.  */
   found_index = charset_matched;
--- 575,581 ----
        Lisp_Object font_def;
        Lisp_Object font_entity, font_object;
 
!       if (i == 0 && charset_matched >= 0)
  {
   /* Try the element matching with the charset ID at first.  */
   found_index = charset_matched;

                                     YAMAMOTO Mitsuharu
                                mituharu@...




 « Return to Thread: set-fontset-font and preferred charset?