diff options
| -rw-r--r-- | src/xfns.c | 70 |
1 files changed, 46 insertions, 24 deletions
diff --git a/src/xfns.c b/src/xfns.c index 0e9d4e60e90..2b9e656b9f1 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -2090,6 +2090,29 @@ xic_create_fontsetname (base_fontname, motif) | |||
| 2090 | return fontsetname; | 2090 | return fontsetname; |
| 2091 | } | 2091 | } |
| 2092 | 2092 | ||
| 2093 | #ifdef DEBUG_XIC_FONTSET | ||
| 2094 | static void | ||
| 2095 | print_fontset_result (xfs, name, missing_list, missing_count) | ||
| 2096 | XFontSet xfs; | ||
| 2097 | char *name; | ||
| 2098 | char **missing_list; | ||
| 2099 | int missing_count; | ||
| 2100 | { | ||
| 2101 | if (xfs) | ||
| 2102 | fprintf (stderr, "XIC Fontset created: %s\n", name); | ||
| 2103 | else | ||
| 2104 | { | ||
| 2105 | fprintf (stderr, "XIC Fontset failed: %s\n", name); | ||
| 2106 | while (missing_count-- > 0) | ||
| 2107 | { | ||
| 2108 | fprintf (stderr, " missing: %s\n", *missing_list); | ||
| 2109 | missing_list++; | ||
| 2110 | } | ||
| 2111 | } | ||
| 2112 | |||
| 2113 | } | ||
| 2114 | #endif | ||
| 2115 | |||
| 2093 | static XFontSet | 2116 | static XFontSet |
| 2094 | xic_create_xfontset (f, base_fontname) | 2117 | xic_create_xfontset (f, base_fontname) |
| 2095 | struct frame *f; | 2118 | struct frame *f; |
| @@ -2126,6 +2149,9 @@ xic_create_xfontset (f, base_fontname) | |||
| 2126 | xfs = XCreateFontSet (FRAME_X_DISPLAY (f), | 2149 | xfs = XCreateFontSet (FRAME_X_DISPLAY (f), |
| 2127 | fontsetname, &missing_list, | 2150 | fontsetname, &missing_list, |
| 2128 | &missing_count, &def_string); | 2151 | &missing_count, &def_string); |
| 2152 | #ifdef DEBUG_XIC_FONTSET | ||
| 2153 | print_fontset_result (xfs, fontsetname, missing_list, missing_count); | ||
| 2154 | #endif | ||
| 2129 | if (missing_list) | 2155 | if (missing_list) |
| 2130 | XFreeStringList (missing_list); | 2156 | XFreeStringList (missing_list); |
| 2131 | if (! xfs) | 2157 | if (! xfs) |
| @@ -2144,6 +2170,9 @@ xic_create_xfontset (f, base_fontname) | |||
| 2144 | xfs = XCreateFontSet (FRAME_X_DISPLAY (f), | 2170 | xfs = XCreateFontSet (FRAME_X_DISPLAY (f), |
| 2145 | p0, &missing_list, | 2171 | p0, &missing_list, |
| 2146 | &missing_count, &def_string); | 2172 | &missing_count, &def_string); |
| 2173 | #ifdef DEBUG_XIC_FONTSET | ||
| 2174 | print_fontset_result (xfs, p0, missing_list, missing_count); | ||
| 2175 | #endif | ||
| 2147 | if (missing_list) | 2176 | if (missing_list) |
| 2148 | XFreeStringList (missing_list); | 2177 | XFreeStringList (missing_list); |
| 2149 | if (xfs) | 2178 | if (xfs) |
| @@ -2159,6 +2188,9 @@ xic_create_xfontset (f, base_fontname) | |||
| 2159 | xfs = XCreateFontSet (FRAME_X_DISPLAY (f), | 2188 | xfs = XCreateFontSet (FRAME_X_DISPLAY (f), |
| 2160 | fontsetname, &missing_list, | 2189 | fontsetname, &missing_list, |
| 2161 | &missing_count, &def_string); | 2190 | &missing_count, &def_string); |
| 2191 | #ifdef DEBUG_XIC_FONTSET | ||
| 2192 | print_fontset_result (xfs, fontsetname, missing_list, missing_count); | ||
| 2193 | #endif | ||
| 2162 | if (missing_list) | 2194 | if (missing_list) |
| 2163 | XFreeStringList (missing_list); | 2195 | XFreeStringList (missing_list); |
| 2164 | xfree (fontsetname); | 2196 | xfree (fontsetname); |
| @@ -2175,30 +2207,6 @@ xic_create_xfontset (f, base_fontname) | |||
| 2175 | 2207 | ||
| 2176 | #ifdef USE_FONT_BACKEND | 2208 | #ifdef USE_FONT_BACKEND |
| 2177 | 2209 | ||
| 2178 | #ifdef DEBUG_XIC_FONTSET | ||
| 2179 | static void | ||
| 2180 | print_fontset_result (xfs, name, missing_list, missing_count) | ||
| 2181 | XFontSet xfs; | ||
| 2182 | char *name; | ||
| 2183 | char **missing_list; | ||
| 2184 | int missing_count; | ||
| 2185 | { | ||
| 2186 | if (xfs) | ||
| 2187 | fprintf (stderr, "XIC Fontset created: %s\n", name); | ||
| 2188 | else | ||
| 2189 | { | ||
| 2190 | fprintf (stderr, "XIC Fontset failed: %s\n", name); | ||
| 2191 | while (missing_count-- > 0) | ||
| 2192 | { | ||
| 2193 | fprintf (stderr, " missing: %s\n", *missing_list); | ||
| 2194 | missing_list++; | ||
| 2195 | } | ||
| 2196 | } | ||
| 2197 | |||
| 2198 | } | ||
| 2199 | #endif | ||
| 2200 | |||
| 2201 | |||
| 2202 | static XFontSet | 2210 | static XFontSet |
| 2203 | xic_create_xfontset2 (f) | 2211 | xic_create_xfontset2 (f) |
| 2204 | struct frame *f; | 2212 | struct frame *f; |
| @@ -2278,6 +2286,20 @@ xic_create_xfontset2 (f) | |||
| 2278 | break; | 2286 | break; |
| 2279 | } | 2287 | } |
| 2280 | } | 2288 | } |
| 2289 | if (! xfs) | ||
| 2290 | { | ||
| 2291 | char *last_resort = "-*-*-*-r-normal--*-*-*-*-*-*"; | ||
| 2292 | |||
| 2293 | missing_list = NULL; | ||
| 2294 | xfs = XCreateFontSet (FRAME_X_DISPLAY (f), last_resort, | ||
| 2295 | &missing_list, &missing_count, &def_string); | ||
| 2296 | #ifdef DEBUG_XIC_FONTSET | ||
| 2297 | print_fontset_result (xfs, last_resort, missing_list, missing_count); | ||
| 2298 | #endif | ||
| 2299 | if (missing_list) | ||
| 2300 | XFreeStringList (missing_list); | ||
| 2301 | } | ||
| 2302 | |||
| 2281 | } | 2303 | } |
| 2282 | 2304 | ||
| 2283 | return xfs; | 2305 | return xfs; |