diff options
| author | Kenichi Handa | 2000-03-21 00:42:32 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2000-03-21 00:42:32 +0000 |
| commit | 6ecb43cedfcce4bb9c60cec33abd2dae6986f052 (patch) | |
| tree | 8d75b3f98a4a2fff3015384c26be692dc8643ca8 /src/xfns.c | |
| parent | 980806b6cf81749205ddc50c81d5fd72ebe1e9d3 (diff) | |
| download | emacs-6ecb43cedfcce4bb9c60cec33abd2dae6986f052.tar.gz emacs-6ecb43cedfcce4bb9c60cec33abd2dae6986f052.zip | |
(Fx_create_frame): Don't cal fs_register_fontset.
(x_create_tip_frame): Likewise.
(Fx_close_connection): Free full_name of font_info.
Diffstat (limited to 'src/xfns.c')
| -rw-r--r-- | src/xfns.c | 59 |
1 files changed, 34 insertions, 25 deletions
diff --git a/src/xfns.c b/src/xfns.c index a08f74eccbf..2873b09720f 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -3093,22 +3093,39 @@ create_frame_xic (f) | |||
| 3093 | base_fontname = "-*-*-*-r-normal--14-*-*-*-*-*-*-*"; | 3093 | base_fontname = "-*-*-*-r-normal--14-*-*-*-*-*-*-*"; |
| 3094 | else | 3094 | else |
| 3095 | { | 3095 | { |
| 3096 | struct fontset_info *fontsetp; | 3096 | /* Determine the base fontname from the ASCII font name of |
| 3097 | int len = 0; | 3097 | FONTSET. */ |
| 3098 | char *ascii_font = (char *) XSTRING (fontset_ascii (fontset))->data; | ||
| 3099 | char *p = ascii_font; | ||
| 3098 | int i; | 3100 | int i; |
| 3099 | 3101 | ||
| 3100 | fontsetp = FRAME_FONTSET_DATA (f)->fontset_table[fontset]; | 3102 | for (i = 0; *p; p++) |
| 3101 | for (i = 0; i <= MAX_CHARSET; i++) | 3103 | if (*p == '-') i++; |
| 3102 | if (fontsetp->fontname[i]) | 3104 | if (i != 14) |
| 3103 | len += strlen (fontsetp->fontname[i]) + 1; | 3105 | /* As the font name doesn't conform to XLFD, we can't |
| 3104 | base_fontname = alloca (len); | 3106 | modify it to get a suitable base fontname for the |
| 3105 | strcpy (base_fontname, fontsetp->fontname[CHARSET_ASCII]); | 3107 | frame. */ |
| 3106 | for (i = MIN_CHARSET_OFFICIAL_DIMENSION1; i <= MAX_CHARSET; i++) | 3108 | base_fontname = "-*-*-*-r-normal--14-*-*-*-*-*-*-*"; |
| 3107 | if (fontsetp->fontname[i]) | 3109 | else |
| 3108 | { | 3110 | { |
| 3109 | strcat (base_fontname, ","); | 3111 | int len = strlen (ascii_font) + 1; |
| 3110 | strcat (base_fontname, fontsetp->fontname[i]); | 3112 | char *p1; |
| 3111 | } | 3113 | |
| 3114 | for (i = 0, p = ascii_font; i < 8; p++) | ||
| 3115 | { | ||
| 3116 | if (*p == '-') | ||
| 3117 | { | ||
| 3118 | i++; | ||
| 3119 | if (i == 3) | ||
| 3120 | p1 = p + 1; | ||
| 3121 | } | ||
| 3122 | } | ||
| 3123 | base_fontname = (char *) alloca (len); | ||
| 3124 | bzero (base_fontname, len); | ||
| 3125 | strcpy (base_fontname, "-*-*-"); | ||
| 3126 | bcopy (p1, base_fontname + 5, p - p1); | ||
| 3127 | strcat (base_fontname, "*-*-*-*-*-*-*"); | ||
| 3128 | } | ||
| 3112 | } | 3129 | } |
| 3113 | xfs = xic_create_xfontset (f, base_fontname); | 3130 | xfs = xic_create_xfontset (f, base_fontname); |
| 3114 | 3131 | ||
| @@ -3880,10 +3897,6 @@ This function is an internal primitive--use `make-frame' instead.") | |||
| 3880 | specbind (Qx_resource_name, name); | 3897 | specbind (Qx_resource_name, name); |
| 3881 | } | 3898 | } |
| 3882 | 3899 | ||
| 3883 | /* Create fontsets from `global_fontset_alist' before handling fonts. */ | ||
| 3884 | for (tem = Vglobal_fontset_alist; CONSP (tem); tem = XCDR (tem)) | ||
| 3885 | fs_register_fontset (f, XCAR (tem)); | ||
| 3886 | |||
| 3887 | /* Extract the window parameters from the supplied values | 3900 | /* Extract the window parameters from the supplied values |
| 3888 | that are needed to determine window geometry. */ | 3901 | that are needed to determine window geometry. */ |
| 3889 | { | 3902 | { |
| @@ -4739,9 +4752,9 @@ If DISPLAY is nil, that stands for the selected frame's display.") | |||
| 4739 | for (i = 0; i < dpyinfo->n_fonts; i++) | 4752 | for (i = 0; i < dpyinfo->n_fonts; i++) |
| 4740 | if (dpyinfo->font_table[i].name) | 4753 | if (dpyinfo->font_table[i].name) |
| 4741 | { | 4754 | { |
| 4755 | if (dpyinfo->font_table[i].name != dpyinfo->font_table[i].full_name) | ||
| 4756 | xfree (dpyinfo->font_table[i].full_name); | ||
| 4742 | xfree (dpyinfo->font_table[i].name); | 4757 | xfree (dpyinfo->font_table[i].name); |
| 4743 | /* Don't free the full_name string; | ||
| 4744 | it is always shared with something else. */ | ||
| 4745 | XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font); | 4758 | XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font); |
| 4746 | } | 4759 | } |
| 4747 | 4760 | ||
| @@ -9435,10 +9448,6 @@ x_create_tip_frame (dpyinfo, parms) | |||
| 9435 | specbind (Qx_resource_name, name); | 9448 | specbind (Qx_resource_name, name); |
| 9436 | } | 9449 | } |
| 9437 | 9450 | ||
| 9438 | /* Create fontsets from `global_fontset_alist' before handling fonts. */ | ||
| 9439 | for (tem = Vglobal_fontset_alist; CONSP (tem); tem = XCDR (tem)) | ||
| 9440 | fs_register_fontset (f, XCAR (tem)); | ||
| 9441 | |||
| 9442 | /* Extract the window parameters from the supplied values | 9451 | /* Extract the window parameters from the supplied values |
| 9443 | that are needed to determine window geometry. */ | 9452 | that are needed to determine window geometry. */ |
| 9444 | { | 9453 | { |