[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: address@hidden: Re: XCreateFontSet called for each X window emacs fr
From: |
Kenichi Handa |
Subject: |
Re: address@hidden: Re: XCreateFontSet called for each X window emacs frame is heavy] |
Date: |
Wed, 18 Jul 2007 10:21:27 +0900 |
User-agent: |
SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.0 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
Sorry for the late response.
In article <address@hidden>, Richard Stallman <address@hidden> writes:
> Would someone please DTRT and ack? I have enclosed two messages.
> Handa, this is in your area.
> From: Alexander Kotelnikov <address@hidden>
> Date: Sat, 30 Jun 2007 16:39:36 +0400
> Subject: XCreateFontSet called for each X window emacs frame is heavy
[...]
> I think it is years now since I had noticed that every new emacs frame
> either first or any subsequent makes all my computers feel bad. X
> display stands still, cursor moves, but does not respond to clicks,
> focus switches slowly. This continues of a split second, but it
> hurts, I assure you. I do not know any other program, that causes
> such problems.
[...]
> 2155 xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
> (gdb)
> 2158 if (missing_list)
> (gdb)
> 2160 if (! xfs)
> (gdb) p fontsetname
> $1 = 0x85d0c80 "-monotype-courier
> new-medium-r-normal-*-13-92-100-100-m-80-adobe-standard,
> - -monotype-courier
> new-medium-r-normal-*-13-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-13-*-*-*-*
> - -*-*-*,-*-*-*-*-*-*-13-*-*-*-*-*-*-*"
I've never met such a problem, and it's very surprising that
XCreateFontSet is that slow.
Could you please compile the attached program (xfs.c), run
it with these arguments:
% ./xfs '-monotype-courier
new-medium-r-normal-*-13-92-100-100-m-80-adobe-standard,-monotype-courier
new-medium-r-normal-*-13-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-13-*-*-*-*-*-*-*,-*-*-*-*-*-*-13-*-*-*-*-*-*-*'
%./xfs ''-monotype-courier
new-medium-r-normal-*-13-92-100-100-m-80-adobe-standard,-monotype-courier
new-medium-r-normal-*-13-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-13-*-*-*-*-*-*-*'
%./xfs ''-monotype-courier
new-medium-r-normal-*-13-92-100-100-m-80-adobe-standard,-monotype-courier
new-medium-r-normal-*-13-*-*-*-*-*-*-*'
and check if they are surely slow?
And also please investigate why the following code in
xic_create_xfontset doesn't find an already created fontset
for the second and the other frames.
/* See if there is another frame already using same fontset. */
FOR_EACH_FRAME (rest, frame)
{
struct frame *cf = XFRAME (frame);
if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf)
&& FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f)
&& FRAME_XIC_BASE_FONTNAME (cf)
&& !strcmp (FRAME_XIC_BASE_FONTNAME (cf), base_fontname))
{
xfs = FRAME_XIC_FONTSET (cf);
break;
}
}
---
Kenichi Handa
address@hidden
--------------------- xfs.c -------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <X11/Xlib.h>
int
main (int argc, char **argv)
{
Display *display;
XFontSet xfs = NULL;
char **missing_list = NULL;
int missing_count;
char *def_string;
setlocale (LC_ALL, "");
display = XOpenDisplay (NULL);
xfs = XCreateFontSet (display, argv[1], &missing_list, &missing_count,
&def_string);
if (! xfs)
printf ("Fontset can't be created from \"%s\".\n", argv[1]);
else
{
printf ("Fontset created successfully.\n");
if (missing_list)
{
int i;
printf ("Missing fonts:\n");
for (i = 0; i < missing_count; i++)
printf (" %s\n", missing_list[i]);
XFreeStringList (missing_list);
}
XFreeFontSet (display, xfs);
}
XCloseDisplay (display);
exit (0);
}