unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Glenn Morris <rgm@gnu.org>
Cc: Simon.Marshall@misys.com, 3659@emacsbugs.donarmstrong.com,
	cyd@stupidchicken.com
Subject: bug#3659: FW: 23.0.95; crash on set-frame-font
Date: Mon, 29 Jun 2009 11:24:03 +0900	[thread overview]
Message-ID: <E1ML6XL-00071p-0g@etlken> (raw)
In-Reply-To: <nkskhm9yyp.fsf@fencepost.gnu.org> (message from Glenn Morris on Fri, 26 Jun 2009 22:45:18 -0400)

In article <nkskhm9yyp.fsf@fencepost.gnu.org>, Glenn Morris <rgm@gnu.org> writes:

> Kenichi Handa wrote:
> > In a debugger, please check the values of filename (LispString),
> > index (LispInt), and xftfont (XftFont *) just before calling
> > XftLockFace at xftfont.c:290.

> A breakpoint in this area is triggered 4 times before the Emacs frame
> appears, then once more after the frame appears. It crashes on the 5th
> time.

> The 5 values of filename are:
> /usr/openwin/lib/X11/fonts/75dpi/courR14.pcf.Z
> /usr/openwin/lib/X11/fonts/75dpi/courR14.pcf.Z
> /usr/openwin/lib/X11/fonts/75dpi/courO14.pcf.Z
> /usr/openwin/lib/X11/fonts/75dpi/courR14.pcf.Z
> /usr/openwin/lib/X11/fonts/100dpi/courB10.pcf.Z

> "index" is always 0.

> "xftfont" is always 0 (perhaps I am printing it wrong? I use "pp".)

You should use the normal p(rint) command for xftfont
because it is not a Lisp object.  But, if "pp xftfont" shows
0, xftfont is actually NULL.

> > By the way, are there any fonts with that you can startup
> > Emacs with --xrm 'Emacs*FontBackend: xft'?

> I didn't check them all, but these work:

> -*-FreeMono-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1
> -monotype-Times New-Roman-normal-normal-normal-*-*-*-*-*-*-0-iso10646-1

> These are both TrueType fonts. I did not find any of the fonts in the
> 75dpi directory that worked (but it was not an exhaustive search).

Hmmm, it seems that there's something wrong in you Xft (or
underlying fontconfig/freetype)

Please compile the attached program and run it (as below).
What is shown?

% gcc `pkg-config --cflags xft` `pkg-config --libs xft` -o xfttest xfttest.c 
% ./xfttest /usr/openwin/lib/X11/fonts/75dpi/courR14.pcf.Z

---
Kenichi Handa
handa@m17n.org

--- xfttest.c ---
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xft/Xft.h>

int
main (int argc, char **argv)
{
  Display *display;
  FcPattern *pat, *match;
  FcObjectSet *objset;
  FcFontSet *fontset;
  FcResult result;
  XftFont *font;
      
  display = XOpenDisplay (NULL);
  if (! display)
    {
      fprintf (stderr, "Can't open a display\n");
      exit (1);
    }
  if (argc < 2)
    {
      fprintf (stderr, "Usage: xfttest FONT-FILE-NAME\n");
      exit (1);
    }

  printf ("Listing a font by file name and index ... ");
  pat = FcPatternBuild (0, FC_FILE, FcTypeString,
			(FcChar8 *) argv[1],
			FC_INDEX, FcTypeInteger, 0, NULL);
  objset = FcObjectSetBuild (FC_FOUNDRY, FC_FAMILY, FC_WEIGHT, FC_SLANT,
			     FC_WIDTH, FC_PIXEL_SIZE, FC_SPACING, FC_SCALABLE,
			     FC_STYLE, FC_FILE, FC_INDEX, NULL);
  fontset = FcFontList (NULL, pat, objset);
  if (fontset && fontset->nfont > 0)
    {
      int i;

      printf ("found these fonts:\n");
      for (i = 0; i < fontset->nfont; i++)
	{
	  FcChar8 *file;

	  printf ("  %02d:", i + 1);
	  if (FcPatternGetString (fontset->fonts[i], FC_FILE, 0, &file)
	      == FcResultMatch)
	    printf ("%s\n", (char *) file);
	  else
	    printf ("no filename\n");
	}
      printf ("Matching the first one ... ");
      match = XftFontMatch (display, 0, fontset->fonts[0], &result);
      if (match)
	{
	  FcChar8 *file;
	  FcPatternGetString (match, FC_FILE, 0, &file);
	  printf (" matched\n  %s opening ... ", file);
	  font = XftFontOpenPattern (display, match);
	  if (font)
	    {
	      printf ("ok\n");
	      XftFontClose (display, font);
	    }
	  else
	    {
	      printf ("no\n");
	    }
	}
      else
	{
	  printf (" not matched\n");
	}
    }
  else
    {
      printf (" none\n");
    }

  exit (0);
}





  parent reply	other threads:[~2009-06-29  2:24 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <63C2A154B1708946B60726AFDBA00AC005E5EC5A@ukmailemea01.misys.global.ad>
     [not found] ` <87iqinxbs7.fsf@stupidchicken.com>
     [not found]   ` <63C2A154B1708946B60726AFDBA00AC005EABBA6@ukmailemea01.misys.global.ad>
     [not found]     ` <87fxdp4ssu.fsf@stupidchicken.com>
     [not found]       ` <E1MJdlh-0002uT-DA@etlken>
2009-06-25  3:35         ` bug#3659: FW: 23.0.95; crash on set-frame-font Chong Yidong
2009-06-25  6:16           ` Kenichi Handa
2009-06-25 18:32             ` Glenn Morris
2009-06-27  1:13               ` Kenichi Handa
2009-06-27  2:45                 ` Glenn Morris
2009-06-27  3:18                   ` Chong Yidong
2009-06-28  1:11                     ` Glenn Morris
2009-06-28  5:24                       ` Chong Yidong
2009-06-29  2:24                   ` Kenichi Handa [this message]
2009-06-29  6:44                     ` Glenn Morris
2009-06-29  7:24                       ` Kenichi Handa
2009-06-29 18:34                         ` Glenn Morris
2009-06-30  0:45                           ` Kenichi Handa
2009-06-30 22:26                             ` Glenn Morris
2009-07-09  8:25                               ` Marshall, Simon
2009-07-09 14:11                                 ` Chong Yidong
2009-07-09 14:38                                   ` Marshall, Simon
2009-07-22 12:21                                   ` Marshall, Simon
2009-07-22 13:58                                     ` Chong Yidong
2009-07-23  9:22                                       ` Marshall, Simon
2009-07-23 11:09                                         ` Kenichi Handa
     [not found]                                           ` <63C2A154B1708946B60726AFDBA00AC00668060C@ukmailemea01.misys.global.ad>
     [not found]                                             ` <E1MU9G3-0008Hv-HO@etlke! ! ! ! ! n >
     [not found]                                             ` <E1MU9G3-0008Hv-HO@etlke! ! ! n>
     [not found]                                             ` <E1MU9G3-0008Hv-HO@etlke! ! ! ! n>
     [not found]                                             ` <E1MU9G3-0008Hv-HO@etlke! ! n>
2009-07-24  1:07                                             ` Kenichi Handa
2009-07-24  8:31                                               ` Marshall, Simon
2009-07-24 11:08                                                 ` Kenichi Handa
2009-07-24 12:09                                                   ` Marshall, Simon
2009-07-24 12:31                                                     ` Kenichi Handa
     [not found]                                                       ` <63C2A154B1708946B60726AFDBA00AC00676DBAF@ukmailemea01.misys.global.ad>
2009-07-24 15:28                                                         ` Chong Yidong
2009-07-24 16:01                                                           ` Marshall, Simon
2009-07-26 19:35                                                             ` Chong Yidong
2009-07-27  9:48                                                               ` Marshall, Simon
2009-07-27  1:44                                                         ` Kenichi Handa
     [not found]                                                           ` <63C2A154B1708946B60726AFDBA00AC0067E980A@ukmailemea01.misys.global.ad>
2009-07-27 16:59                                                             ` Chong Yidong
2009-07-27 17:02                                                             ` Chong Yidong
2009-07-28  2:08                                                             ` Kenichi Handa
2009-07-28  8:38                                                               ` Marshall, Simon
2009-06-27  2:48 Chong Yidong
  -- strict thread matches above, loose matches on Subject: below --
2009-06-27  3:08 Chong Yidong
2009-06-28  1:04 ` Glenn Morris

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=E1ML6XL-00071p-0g@etlken \
    --to=handa@m17n.org \
    --cc=3659@emacsbugs.donarmstrong.com \
    --cc=Simon.Marshall@misys.com \
    --cc=cyd@stupidchicken.com \
    --cc=rgm@gnu.org \
    /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).